fix: 修复build警告循环依赖问题
This commit is contained in:
@@ -16,6 +16,7 @@ import autoprefixer from 'autoprefixer'
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
return {
|
||||
base: '/',
|
||||
plugins: [
|
||||
react(),
|
||||
legacy({
|
||||
@@ -91,26 +92,26 @@ export default defineConfig(({ mode }) => {
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'], // 默认值,这些文件引入时不需要写后缀
|
||||
},
|
||||
css: {
|
||||
modules: {
|
||||
// 一般我们可以通过 generateScopedName 属性来对生成的类名进行自定义
|
||||
// 其中,name 表示当前文件名,local 表示类名
|
||||
generateScopedName: "[name]__[local]___[hash:base64:5]"
|
||||
},
|
||||
postcss:{
|
||||
plugins:[
|
||||
postcssPresetEnv(),
|
||||
autoprefixer({ // 自动添加前缀
|
||||
overrideBrowserslist: [
|
||||
"Android 4.1",
|
||||
"iOS 7.1",
|
||||
"Chrome > 31",
|
||||
"ff > 31",
|
||||
"ie >= 8"
|
||||
],
|
||||
})
|
||||
|
||||
]
|
||||
},
|
||||
modules: {
|
||||
// 一般我们可以通过 generateScopedName 属性来对生成的类名进行自定义
|
||||
// 其中,name 表示当前文件名,local 表示类名
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
||||
},
|
||||
postcss: {
|
||||
plugins: [
|
||||
postcssPresetEnv(),
|
||||
autoprefixer({
|
||||
// 自动添加前缀
|
||||
overrideBrowserslist: [
|
||||
'Android 4.1',
|
||||
'iOS 7.1',
|
||||
'Chrome > 31',
|
||||
'ff > 31',
|
||||
'ie >= 8',
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
javascriptEnabled: true,
|
||||
@@ -150,6 +151,11 @@ export default defineConfig(({ mode }) => {
|
||||
chunkFileNames: 'js/[name]-[hash].js', // 引入文件名的名称
|
||||
entryFileNames: 'js/[name]-[hash].js', // 包的入口文件名称
|
||||
assetFileNames: '[ext]/[name]-[hash].[ext]', // 资源文件像 字体,图片等
|
||||
manualChunks(id) {
|
||||
if (id.includes('node_modules')) {
|
||||
return id.toString().split('node_modules/')[1].split('/')[0].toString()
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user