|
|
|
@ -10,20 +10,6 @@ const {
|
|
|
|
|
|
|
|
|
|
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(),
|
|
|
|
@ -38,16 +24,10 @@ module.exports = override(
|
|
|
|
|
}),
|
|
|
|
|
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')
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
);
|