Last active
December 17, 2018 00:07
-
-
Save victors1681/94c418cae460885ae04da7ccb6d3cc4c 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
const getPlugins = env => | |
[ | |
new HtmlWebpackPlugin({ | |
filename: "index.html", | |
template: path.join(__dirname, "public/index.html"), | |
inject: true, | |
chunks: ["app", "vendors"] | |
}), | |
env.analyze && new BundleAnalyzerPlugin(), | |
new MiniCssExtractPlugin({ | |
filename: env.NODE_ENV === "development" ? "[name].css" : "css/[name].[chunkhash:8].css" | |
}), | |
env.NODE_ENV === "development" && new webpack.HotModuleReplacementPlugin() | |
].filter(plugin => plugin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment