Sil*_*der 5 autoprefixer postcss svelte vite
我在 Svelte 中遇到了这个奇怪的错误;每次我运行时npm run dev
,都会出现这个vite错误:
[vite] Internal server error: Failed to load PostCSS config (searchPath: /Users/Documents/Personal projects): [Failed to load PostCSS config] Failed to load PostCSS config (searchPath: /Users/Documents/Personal projects): [Failed to load PostCSS config] Failed to load PostCSS config (searchPath: /Users/Documents/Personal projects): [Error] Cannot find module 'autoprefixer'
Run Code Online (Sandbox Code Playgroud)
我是 vite 新手,所以我花了一个小时的研究,找出如何导出模块,我能够通过创建一个postcss.config.cjs
文件并在文件中添加来修复它:
module.exports = {
autoprefixer: {}
}
Run Code Online (Sandbox Code Playgroud)
我希望这可以帮助遇到相同/类似错误的任何人。
Sil*_*der 13
创建postcss.config.cjs
文件并添加:
module.exports = {
autoprefixer: {}
}
Run Code Online (Sandbox Code Playgroud)
它没有构建的原因是因为 svelte 没有导出 autoprefixer 模块
归档时间: |
|
查看次数: |
13701 次 |
最近记录: |