diff --git a/server/routes.js b/server/routes.js index 8b23d2a3..a5b4535b 100644 --- a/server/routes.js +++ b/server/routes.js @@ -17,6 +17,8 @@ const router = new Router(); // } // }); +console.log(process.env.NODE_ENV); + if (process.env.NODE_ENV === 'production') { router.get('/service-worker.js', async (ctx) => { ctx.set('Content-Type', 'application/javascript'); @@ -25,6 +27,7 @@ if (process.env.NODE_ENV === 'production') { }); router.get('/static/*', async (ctx) => { + console.log(path.join(__dirname, '../dist/', ctx.path.substring(8))); const stats = await sendfile(ctx, path.join(__dirname, '../dist/', ctx.path.substring(8))); }); } diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 6c705322..991765e3 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -11,7 +11,7 @@ productionWebpackConfig = Object.assign(commonWebpackConfig, { ], output: { path: path.join(__dirname, 'dist'), - filename: 'bundle.[hash].js', + filename: 'bundle.js', publicPath: '/static/' }, });