Updated webpack config for prod builds.

This commit is contained in:
2020-07-18 22:22:20 +02:00
parent 0dd3944fd2
commit 7ce54306b7
7 changed files with 99 additions and 51 deletions

View File

@@ -8,7 +8,7 @@ const helpers = require("./helpers");
const commonConfig = require("./webpack.config.common");
const environment = require("./env/dev.env");
const webpackConfig = merge(commonConfig(true), {
let webpackConfig = merge(commonConfig(true), {
mode: "development",
devtool: "cheap-module-eval-source-map",
output: {
@@ -26,19 +26,29 @@ const webpackConfig = merge(commonConfig(true), {
plugins: [
new webpack.EnvironmentPlugin(environment),
new webpack.HotModuleReplacementPlugin(),
new FriendlyErrorsPlugin(),
new HtmlPlugin({ template: "frontend/index.html", chunksSortMode: "dependency" })
new FriendlyErrorsPlugin()
],
devServer: {
compress: true,
historyApiFallback: true,
hot: true,
overlay: true,
port: 8080,
stats: {
normal: true
}
}
});
webpackConfig = merge(webpackConfig, {
entry: {
main: ["@babel/polyfill", helpers.root("src", "vinlottis-init")]
},
plugins: [
new HtmlPlugin({
template: "src/templates/Index.html",
chunksSortMode: "dependency"
})
]
});
module.exports = webpackConfig;