Juke build system port (#7186)

This commit is contained in:
Selis
2023-11-13 20:12:54 +01:00
committed by GitHub
parent 89f544ff96
commit 1f0914ee78
44 changed files with 6375 additions and 697 deletions

View File

@@ -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';
}