- Extracted CSS into own file in production - Minified CSS in production - Added TerserJS back in to minify JS in production - Minified HTML in production as well
28 lines
506 B
JavaScript
28 lines
506 B
JavaScript
const path = require("path");
|
|
var HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
module.exports = {
|
|
entry: {
|
|
main: "./src/index.js",
|
|
vendor: "./src/vendor.js"
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.html$/,
|
|
use: ["html-loader"]
|
|
},
|
|
{
|
|
test: /\.(svg|png|jpg|gif)$/,
|
|
use: {
|
|
loader: "file-loader",
|
|
options: {
|
|
name: "[name].[hash].[ext]",
|
|
outputPath: "imgs"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
};
|