Update webpack HMR for new dev environment

This commit is contained in:
Dane Everitt 2022-02-12 13:18:08 -05:00
parent 0bd182c2a7
commit a071676be4
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 3 additions and 3 deletions

View file

@ -112,7 +112,7 @@
"watch": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --watch --progress", "watch": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --watch --progress",
"build": "cross-env NODE_ENV=development ./node_modules/.bin/webpack --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", "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": [ "browserslist": [
"> 0.5%", "> 0.5%",

View file

@ -19,7 +19,7 @@ module.exports = {
path: path.join(__dirname, '/public/assets'), path: path.join(__dirname, '/public/assets'),
filename: isProduction ? 'bundle.[chunkhash:8].js' : 'bundle.[hash:8].js', filename: isProduction ? 'bundle.[chunkhash:8].js' : 'bundle.[hash:8].js',
chunkFilename: isProduction ? '[name].[chunkhash:8].js' : '[name].[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', crossOriginLoading: 'anonymous',
}, },
module: { module: {
@ -115,7 +115,7 @@ module.exports = {
devServer: { devServer: {
compress: true, compress: true,
contentBase: path.join(__dirname, '/public'), contentBase: path.join(__dirname, '/public'),
publicPath: (process.env.PUBLIC_PATH || '') + '/assets/', publicPath: process.env.WEBPACK_PUBLIC_PATH || '/assets/',
allowedHosts: [ allowedHosts: [
'.pterodactyl.test', '.pterodactyl.test',
], ],