const path = require("path") const HtmlWebpackPlugin = require("html-webpack-plugin") const SRC_DIR = path.resolve(__dirname, "src"); const DIST_DIR = path.resolve(__dirname, "dist"); const isProd = process.env.NODE_ENV === "production" module.exports = { entry: { main: SRC_DIR + '/Index.bs.js', }, mode: isProd ? "production" : "development", devtool: "source-map", output: { path: DIST_DIR, filename: '[name].js', publicPath: './', }, plugins: [ new HtmlWebpackPlugin({ template: "src/index.html", inject: false, }) ], devServer: { compress: true, contentBase: DIST_DIR, port: process.env.PORT || 8000, historyApiFallback: true, }, module: { rules: [ ] } }