You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
53 lines
1.4 KiB
const {
|
|
override,
|
|
addLessLoader,
|
|
disableEsLint,
|
|
addBundleVisualizer,
|
|
addWebpackAlias,
|
|
fixBabelImports,
|
|
addWebpackPlugin
|
|
} = require("customize-cra")
|
|
|
|
const path = require('path');
|
|
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
|
|
const UglifyJsPlugin = require("uglifyjs-webpack-plugin")
|
|
const myPlugin = [
|
|
new UglifyJsPlugin(
|
|
{
|
|
uglifyOptions: {
|
|
warnings: false,
|
|
compress: {
|
|
drop_debugger: true,
|
|
drop_console: true
|
|
}
|
|
}
|
|
}
|
|
)
|
|
]
|
|
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
|
|
module.exports = override(
|
|
disableEsLint(),
|
|
// addBundleVisualizer(),
|
|
addLessLoader({
|
|
javascriptEnabled: true
|
|
}),
|
|
fixBabelImports('import', {
|
|
libraryName: 'antd',
|
|
libraryDirectory: 'es',
|
|
style: true
|
|
}),
|
|
addWebpackPlugin(new MonacoWebpackPlugin({})),
|
|
(config) => {
|
|
if (process.env.NODE_ENV === "production") config.devtool = false;
|
|
if (process.env.NODE_ENV !== "development") config.plugins = [...config.plugins, ...myPlugin]
|
|
if (process.env.NODE_ENV !== "development") {
|
|
config.output.publicPath = `/h5educoderbuild/`;
|
|
}
|
|
config.resolve.plugins = config.resolve.plugins.filter(plugin => !(plugin instanceof ModuleScopePlugin));
|
|
return config
|
|
},
|
|
addWebpackAlias({
|
|
"educoder": path.resolve(__dirname, './src/common/educoder.js')
|
|
}),
|
|
|
|
); |