From a071676be4e8a5d52d300eb9204f4f933bf62c7d Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 12 Feb 2022 13:18:08 -0500 Subject: [PATCH] Update webpack HMR for new dev environment --- package.json | 2 +- webpack.config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 77db3475d..1f3df5673 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "watch": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --watch --progress", "build": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --progress", "build:production": "yarn run clean && cross-env NODE_ENV=production ./node_modules/.bin/webpack --mode production", - "serve": "yarn run clean && cross-env PUBLIC_PATH=https://pterodactyl.test:8080 NODE_ENV=development webpack-dev-server --host 0.0.0.0 --hot --https --key /etc/ssl/private/pterodactyl.test-key.pem --cert /etc/ssl/private/pterodactyl.test.pem" + "serve": "yarn run clean && cross-env WEBPACK_PUBLIC_PATH=/webpack@hmr/ NODE_ENV=development webpack-dev-server --host 0.0.0.0 --port 8080 --public https://pterodactyl.test --hot" }, "browserslist": [ "> 0.5%", diff --git a/webpack.config.js b/webpack.config.js index c97abdd19..777b0be1b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,7 +19,7 @@ module.exports = { path: path.join(__dirname, '/public/assets'), filename: isProduction ? 'bundle.[chunkhash:8].js' : 'bundle.[hash:8].js', chunkFilename: isProduction ? '[name].[chunkhash:8].js' : '[name].[hash:8].js', - publicPath: (process.env.PUBLIC_PATH || '') + '/assets/', + publicPath: (process.env.WEBPACK_PUBLIC_PATH || '/assets/'), crossOriginLoading: 'anonymous', }, module: { @@ -115,7 +115,7 @@ module.exports = { devServer: { compress: true, contentBase: path.join(__dirname, '/public'), - publicPath: (process.env.PUBLIC_PATH || '') + '/assets/', + publicPath: process.env.WEBPACK_PUBLIC_PATH || '/assets/', allowedHosts: [ '.pterodactyl.test', ],