build-utils/webpack.development.js
const { merge } = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'development',
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
},
devServer: {
historyApiFallback: true,
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.html',
minify: {
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true,
},
}),
],
devtool: 'source-map',
});