From fa35c147dd430c5e9214971a9f9e3ab44a1299ad Mon Sep 17 00:00:00 2001 From: Nick Girardo Date: Wed, 11 Aug 2021 02:31:17 -0400 Subject: [PATCH] Webpack adjustments --- conf/webpack.dev.js | 9 +++++++-- package.json | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/conf/webpack.dev.js b/conf/webpack.dev.js index 6063e07..f12df33 100644 --- a/conf/webpack.dev.js +++ b/conf/webpack.dev.js @@ -6,8 +6,9 @@ module.exports = { entry: './src/index.tsx', devtool: 'inline-source-map', output: { + publicPath: '/', path: path.resolve(__dirname, '../build'), - filename: '[name].js', + filename: 'bundle.js', }, resolve: { extensions: ['', '.js', '.ts', '.jsx', '.tsx'], @@ -36,7 +37,11 @@ module.exports = { }), ], devServer: { - contentBase: path.resolve(__dirname, './build'), + contentBase: path.resolve(__dirname, '../build'), + historyApiFallback: { + disableDotRule: true, + index: '/', + }, }, watchOptions: { ignored: /node_modules/, diff --git a/package.json b/package.json index ac42c91..2cf33a6 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "typescript": "^4.3.5" }, "scripts": { + "prestart": "if [ -d \"build\" ]; then rm -r \"build\"; fi", "start": "webpack serve --config conf/webpack.dev.js", "prebuild": "if [ -d \"build\" ]; then rm -r \"build\"; fi", "build": "webpack --config conf/webpack.prod.js",