Use HtmlWebpackPlugin for eployments
This commit is contained in:
File diff suppressed because one or more lines are too long
1
dist/bundle.0fbe6de0fb85ebae62bf.js.map
vendored
Normal file
1
dist/bundle.0fbe6de0fb85ebae62bf.js.map
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"bundle.0fbe6de0fb85ebae62bf.js","sources":["webpack:///bundle.0fbe6de0fb85ebae62bf.js","webpack:///"],"mappings":"AAAA;ACwwHA;AAy/EA;AAyiFA;AA28FA;AAr1IA;AA45IA;;;;;AAo9GA;;;;;AAglFA;AAg7GA;;;;;;;;;;;;;;AAgxCA;AA+rHA;AA8pEA;AAklEA;AAmqEA;AA0gEA;AAowFA;AAunIA;AA2sEA;AAwiEA;AAygDA;AA6hJA;AA4kEA;AA8iIA;AA+mHA;AAu5FA;AA8zEA","sourceRoot":""}
|
1
dist/bundle.js.map
vendored
1
dist/bundle.js.map
vendored
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"bundle.js","sources":["webpack:///bundle.js","webpack:///"],"mappings":"AAAA;ACwwHA;AAy/EA;AAyiFA;AA28FA;AAr1IA;AA45IA;;;;;AAo9GA;;;;;AAglFA;AAg7GA;;;;;;;;;;;;;;AAgxCA;AA+rHA;AA8pEA;AAklEA;AAmqEA;AA0gEA;AAowFA;AAunIA;AA0sEA;AAyiEA;AAugDA;AA8hJA;AAsyEA;AAo1HA;AA6lHA;AAq6FA;AA8yEA","sourceRoot":""}
|
|
2
dist/index.html
vendored
2
dist/index.html
vendored
@ -15,5 +15,5 @@
|
|||||||
// });
|
// });
|
||||||
// };
|
// };
|
||||||
</script>
|
</script>
|
||||||
<script src="/static/bundle.js"></script></body>
|
<script type="text/javascript" src="/static/bundle.0fbe6de0fb85ebae62bf.js"></script></body>
|
||||||
</html>
|
</html>
|
@ -34,7 +34,7 @@
|
|||||||
"debug": "^2.2.0",
|
"debug": "^2.2.0",
|
||||||
"extract-text-webpack-plugin": "^1.0.1",
|
"extract-text-webpack-plugin": "^1.0.1",
|
||||||
"highlight.js": "^9.4.0",
|
"highlight.js": "^9.4.0",
|
||||||
"html-webpack-plugin": "^2.16.1",
|
"html-webpack-plugin": "^2.17.0",
|
||||||
"http-errors": "^1.4.0",
|
"http-errors": "^1.4.0",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"jsonwebtoken": "^5.7.0",
|
"jsonwebtoken": "^5.7.0",
|
||||||
|
@ -31,7 +31,7 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
router.get('*', async (ctx) => {
|
router.get('*', async (ctx) => {
|
||||||
const stats = await sendfile(ctx, path.join(__dirname, './static/dev.html'));
|
const stats = await sendfile(ctx, path.join(__dirname, '../dist/index.html'));
|
||||||
if (!ctx.status) ctx.throw(httpErrors.NotFound());
|
if (!ctx.status) ctx.throw(httpErrors.NotFound());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
commonWebpackConfig = require('./webpack.config');
|
commonWebpackConfig = require('./webpack.config');
|
||||||
|
|
||||||
@ -11,11 +12,14 @@ productionWebpackConfig = Object.assign(commonWebpackConfig, {
|
|||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, 'dist'),
|
path: path.join(__dirname, 'dist'),
|
||||||
filename: 'bundle.js',
|
filename: 'bundle.[hash].js',
|
||||||
publicPath: '/static/'
|
publicPath: '/static/',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
productionWebpackConfig.plugins.push(new HtmlWebpackPlugin({
|
||||||
|
template: 'server/static/index.html'
|
||||||
|
}));
|
||||||
productionWebpackConfig.plugins.push(new webpack.optimize.OccurenceOrderPlugin());
|
productionWebpackConfig.plugins.push(new webpack.optimize.OccurenceOrderPlugin());
|
||||||
productionWebpackConfig.plugins.push(
|
productionWebpackConfig.plugins.push(
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
|
Reference in New Issue
Block a user