Debugging
This commit is contained in:
@ -17,6 +17,8 @@ const router = new Router();
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
console.log(process.env.NODE_ENV);
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
router.get('/service-worker.js', async (ctx) => {
|
router.get('/service-worker.js', async (ctx) => {
|
||||||
ctx.set('Content-Type', 'application/javascript');
|
ctx.set('Content-Type', 'application/javascript');
|
||||||
@ -25,6 +27,7 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.get('/static/*', async (ctx) => {
|
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)));
|
const stats = await sendfile(ctx, path.join(__dirname, '../dist/', ctx.path.substring(8)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ productionWebpackConfig = Object.assign(commonWebpackConfig, {
|
|||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, 'dist'),
|
path: path.join(__dirname, 'dist'),
|
||||||
filename: 'bundle.[hash].js',
|
filename: 'bundle.js',
|
||||||
publicPath: '/static/'
|
publicPath: '/static/'
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user