mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Juke build system port (#7186)
This commit is contained in:
@@ -26,10 +26,10 @@ const createStats = (verbose) => ({
|
||||
|
||||
// prettier-ignore
|
||||
module.exports = (env = {}, argv) => {
|
||||
const mode = argv.mode === 'production' ? 'production' : 'development';
|
||||
const mode = argv.mode || 'production';
|
||||
const bench = env.TGUI_BENCH;
|
||||
const config = {
|
||||
mode,
|
||||
mode: mode === 'production' ? 'production' : 'development',
|
||||
context: path.resolve(__dirname),
|
||||
target: ['web', 'es3', 'browserslist:ie 8'],
|
||||
entry: {
|
||||
@@ -108,7 +108,7 @@ module.exports = (env = {}, argv) => {
|
||||
stats: createStats(true),
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: env.NODE_ENV || argv.mode || 'development',
|
||||
NODE_ENV: env.NODE_ENV || mode,
|
||||
WEBPACK_HMR_ENABLED: env.WEBPACK_HMR_ENABLED || argv.hot || false,
|
||||
DEV_SERVER_IP: env.DEV_SERVER_IP || null,
|
||||
}),
|
||||
@@ -129,7 +129,7 @@ module.exports = (env = {}, argv) => {
|
||||
}
|
||||
|
||||
// Production build specific options
|
||||
if (argv.mode === 'production') {
|
||||
if (mode === 'production') {
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
config.optimization.minimizer = [
|
||||
new TerserPlugin({
|
||||
@@ -146,7 +146,7 @@ module.exports = (env = {}, argv) => {
|
||||
}
|
||||
|
||||
// Development build specific options
|
||||
if (argv.mode !== 'production') {
|
||||
if (mode !== 'production') {
|
||||
config.devtool = 'cheap-module-source-map';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user