const { merge } = require('webpack-merge'); const common = require('./webpack.common.js'); const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = merge(common, { mode: 'development', devtool: 'inline-source-map', devServer: { static: { directory: path.join(__dirname, 'public'), }, hot: true, historyApiFallback: { disableDotRule: true, index: '/portal/', }, port: 3000, client: { overlay: { errors: true, warnings: false, }, }, }, plugins: [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development'), 'process.env.PUBLIC_URL': JSON.stringify('/portal'), }), // Replace HtmlWebpackPlugin to use template processing new HtmlWebpackPlugin({ inject: true, template: path.resolve(__dirname, 'public/index.html'), templateParameters: { PUBLIC_URL: '/portal', }, }), ], });