|
|
@ -1,4 +1,3 @@
|
|
|
|
/* eslint-disable filenames/match-exported */
|
|
|
|
|
|
|
|
const path = require('path');
|
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
|
@ -7,21 +6,22 @@ const LiveReloadPlugin = require('webpack-livereload-plugin');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
|
|
|
|
|
|
|
|
const uiFolder = 'UI';
|
|
|
|
module.exports = (env) => {
|
|
|
|
const frontendFolder = path.join(__dirname, '..');
|
|
|
|
const uiFolder = 'UI';
|
|
|
|
const srcFolder = path.join(frontendFolder, 'src');
|
|
|
|
const frontendFolder = path.join(__dirname, '..');
|
|
|
|
const isProduction = process.argv.indexOf('--production') > -1;
|
|
|
|
const srcFolder = path.join(frontendFolder, 'src');
|
|
|
|
const isProfiling = isProduction && process.argv.indexOf('--profile') > -1;
|
|
|
|
const isProduction = !!env.production;
|
|
|
|
const inlineWebWorkers = 'no-fallback';
|
|
|
|
const isProfiling = isProduction && !!env.profile;
|
|
|
|
|
|
|
|
const inlineWebWorkers = 'no-fallback';
|
|
|
|
|
|
|
|
|
|
|
|
const distFolder = path.resolve(frontendFolder, '..', '_output', uiFolder);
|
|
|
|
const distFolder = path.resolve(frontendFolder, '..', '_output', uiFolder);
|
|
|
|
|
|
|
|
|
|
|
|
console.log('Source Folder:', srcFolder);
|
|
|
|
console.log('Source Folder:', srcFolder);
|
|
|
|
console.log('Output Folder:', distFolder);
|
|
|
|
console.log('Output Folder:', distFolder);
|
|
|
|
console.log('isProduction:', isProduction);
|
|
|
|
console.log('isProduction:', isProduction);
|
|
|
|
console.log('isProfiling:', isProfiling);
|
|
|
|
console.log('isProfiling:', isProfiling);
|
|
|
|
|
|
|
|
|
|
|
|
const config = {
|
|
|
|
const config = {
|
|
|
|
mode: isProduction ? 'production' : 'development',
|
|
|
|
mode: isProduction ? 'production' : 'development',
|
|
|
|
devtool: 'source-map',
|
|
|
|
devtool: 'source-map',
|
|
|
|
|
|
|
|
|
|
|
@ -237,9 +237,9 @@ const config = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (isProfiling) {
|
|
|
|
if (isProfiling) {
|
|
|
|
config.resolve.alias['react-dom$'] = 'react-dom/profiling';
|
|
|
|
config.resolve.alias['react-dom$'] = 'react-dom/profiling';
|
|
|
|
config.resolve.alias['scheduler/tracing'] = 'scheduler/tracing-profiling';
|
|
|
|
config.resolve.alias['scheduler/tracing'] = 'scheduler/tracing-profiling';
|
|
|
|
|
|
|
|
|
|
|
@ -255,7 +255,7 @@ if (isProfiling) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = config;
|
|
|
|
return config;
|
|
|
|
/* eslint-enable filenames/match-exported */
|
|
|
|
};
|
|
|
|