2 Star 1 Fork 0

一笑/自动化营销平台

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
craco.config.js 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
一笑 提交于 2024-03-09 14:15 . first commit
/* craco.config.js */
const CracoLessPlugin = require('craco-less');
const WebpackBar = require('webpackbar')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const path = require('path')
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin')
module.exports = {
devServer: {
host: "localhost",
client: {
progress: true,
},
},
webpack: {
cache: true,
configure: (webpackConfig, { env, paths }) => {
//webpackConfig.stats = 'errors-only'//这样才会生效
// 修改build的生成文件名称
paths.appBuild = 'dist';
webpackConfig.output = {
...webpackConfig.output,
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
}//修改输出为dist文件
// console.log(webpackConfig);//不懂怎样修改的可以看一下webpackConfig有啥,然后对它的一直配置进行修改。
return webpackConfig
},
plugins: [
new UglifyJsPlugin({
uglifyOptions: {
compress: {
drop_debugger: true,
//清楚console
drop_console: true,
},
},
sourceMap: false,
parallel: true,
}),
/* new BundleAnalyzerPlugin(), */
new WebpackBar({
profile: true,
color: '#fa8c16',
})
],
optimization: {
splitChunks: {
cacheGroups: {
commons: {
chunks: 'initial',
minChunks: 2, maxInitialRequests: 5,
minSize: 0
},
vendor: {
test: /node_modules/,
chunks: 'initial',
name: 'vendor',
priority: 10,
enforce: true
}
}
}
}
},
plugins: [
{
plugin: CracoLessPlugin,
options: {
sourceMap: false,
lessLoaderOptions: {
lessOptions: {
modifyVars: { '@primary-color': '#008060' },
javascriptEnabled: true,
},
},
},
}
],
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yixao-wl/automated-marketing-platform.git
git@gitee.com:yixao-wl/automated-marketing-platform.git
yixao-wl
automated-marketing-platform
自动化营销平台
master

搜索帮助