Browse Source
Update vite.config.js
增加新的组件后,vite打包报错@charset,需要增加配置
master
java2sap
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
17 additions and
0 deletions
-
vite.config.js
|
|
@ -32,5 +32,22 @@ export default defineConfig(({ mode, command }) => { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
|
|
|
|
|
|
css: { |
|
|
|
|
|
postcss: { |
|
|
|
|
|
plugins: [ |
|
|
|
|
|
{ |
|
|
|
|
|
postcssPlugin: 'internal:charset-removal', |
|
|
|
|
|
AtRule: { |
|
|
|
|
|
charset: (atRule) => { |
|
|
|
|
|
if (atRule.name === 'charset') { |
|
|
|
|
|
atRule.remove(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|