Addapt dev settings
This commit is contained in:
parent
a99941eb2b
commit
80f51e0af2
|
@ -135,8 +135,8 @@
|
|||
"lint": "eslint ./resources/scripts/**/*.{ts,tsx} --ext .ts,.tsx",
|
||||
"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 WEBPACK_PUBLIC_PATH=/webpack@hmr/ NODE_ENV=development webpack-dev-server --host 0.0.0.0 --port 8080 --public https://pterodactyl.test --hot"
|
||||
"build:production": "yarn run clean && cross-env NODE_ENV=production ./node_modules/.bin/webpack --mode production --progress",
|
||||
"serve": "yarn run clean && cross-env WEBPACK_PUBLIC_PATH=/webpack@hmr/ NODE_ENV=development webpack-dev-server --host 0.0.0.0 --port 8081 --hot"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 0.5%",
|
||||
|
|
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
cache: true,
|
||||
target: 'web',
|
||||
mode: process.env.NODE_ENV,
|
||||
devtool: isProduction ? false : (process.env.DEVTOOL || 'eval-source-map'),
|
||||
devtool: isProduction ? false : process.env.DEVTOOL || 'eval-source-map',
|
||||
performance: {
|
||||
hints: false,
|
||||
},
|
||||
|
@ -20,7 +20,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.WEBPACK_PUBLIC_PATH || '/assets/'),
|
||||
publicPath: process.env.WEBPACK_PUBLIC_PATH || '/assets/',
|
||||
crossOriginLoading: 'anonymous',
|
||||
},
|
||||
module: {
|
||||
|
@ -72,7 +72,7 @@ module.exports = {
|
|||
test: /\.js$/,
|
||||
enforce: 'pre',
|
||||
loader: 'source-map-loader',
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
stats: {
|
||||
|
@ -109,15 +109,19 @@ module.exports = {
|
|||
syntactic: true,
|
||||
},
|
||||
},
|
||||
eslint: isProduction ? undefined : {
|
||||
files: `${path.join(__dirname, '/resources/scripts')}/**/*.{ts,tsx}`,
|
||||
}
|
||||
eslint: isProduction
|
||||
? undefined
|
||||
: {
|
||||
files: `${path.join(__dirname, '/resources/scripts')}/**/*.{ts,tsx}`,
|
||||
},
|
||||
}),
|
||||
process.env.ANALYZE_BUNDLE ? new BundleAnalyzerPlugin({
|
||||
analyzerHost: '0.0.0.0',
|
||||
analyzerPort: 8081,
|
||||
}) : null
|
||||
].filter(p => p),
|
||||
process.env.ANALYZE_BUNDLE
|
||||
? new BundleAnalyzerPlugin({
|
||||
analyzerHost: '0.0.0.0',
|
||||
analyzerPort: 8081,
|
||||
})
|
||||
: null,
|
||||
].filter((p) => p),
|
||||
optimization: {
|
||||
usedExports: true,
|
||||
sideEffects: false,
|
||||
|
@ -146,11 +150,16 @@ module.exports = {
|
|||
compress: true,
|
||||
contentBase: path.join(__dirname, '/public'),
|
||||
publicPath: process.env.WEBPACK_PUBLIC_PATH || '/assets/',
|
||||
allowedHosts: [
|
||||
'.pterodactyl.test',
|
||||
],
|
||||
writeToDisk: true,
|
||||
allowedHosts: ['localhost'],
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
},
|
||||
proxy: {
|
||||
'*': {
|
||||
target: 'http://localhost:8000/',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue