Created
January 12, 2019 22:54
-
-
Save BiosBoy/48da3d0b6fbd159e2b5baaed9281f38c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------------------ | |
// STAGE PLUGINS INJECTION! [DEVELOPMENT, PRODUCTION, TESTING] | |
// ------------------------------------ | |
const stagePlugins = { | |
test: [new BundleAnalyzerPlugin()], | |
development: [ | |
new HtmlWebpackPlugin({ | |
template: path.resolve('./src/index.html'), | |
filename: 'index.html', | |
inject: 'body', | |
minify: false, | |
chunksSortMode: 'auto' | |
}), | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoEmitOnErrorsPlugin() | |
], | |
production: [ | |
new MiniCssExtractPlugin({ | |
filename: '[name].[hash].css', | |
chunkFilename: '[name].[hash].css' | |
}), | |
new HtmlWebpackPlugin({ | |
template: path.resolve('./src/index.html'), | |
filename: 'index.html', | |
inject: 'body', | |
minify: { | |
collapseWhitespace: true | |
}, | |
chunksSortMode: 'auto' | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment