cube-studio/myapp/vision/config-overrides.js

35 lines
913 B
JavaScript
Raw Normal View History

2021-08-17 17:00:34 +08:00
/* eslint-disable @typescript-eslint/no-var-requires */
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
2021-09-07 18:05:36 +08:00
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
2021-08-17 17:00:34 +08:00
const path = require('path');
const paths = require('react-scripts/config/paths');
// 合并项目,修改打包输出的路径
paths.appBuild = path.join(path.dirname(paths.appBuild), '../static/appbuilder/vison');
module.exports = {
webpack: config => {
2021-09-07 18:05:36 +08:00
config.devtool = false;
2021-08-17 17:00:34 +08:00
// alias
config.resolve.alias = {
...config.resolve.alias,
'@src': path.resolve(__dirname, 'src'),
};
// plugin
config.plugins.push(
new MonacoWebpackPlugin({
languages: ['json'],
}),
);
2021-10-12 10:17:37 +08:00
// if (process.env.NODE_ENV !== 'production') {
// config.plugins.push(
// new BundleAnalyzerPlugin()
// )
// }
2021-09-07 18:05:36 +08:00
2021-08-17 17:00:34 +08:00
return config;
},
};