目前百度搜索,官方文档上搜索,出现如下的解决方案:
- 百度最多浏览方案:umi中配置sass
- 官方文档方案:FAQ:如何使用sass.
产生问题:
• 问题一:You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
• 问题二:Invalid config key: sass
正确解决方案:
正确解决方案已记录在我的语雀账号,请点击链接移步,完整解决方案:
踩坑:如何在Umi中配置使用Sass?
简述:
- 安装 @umijs/plugin-sass
- 安装 node-sass 和 sass-loader
- 配置: .umirc.ts(js)
export default defineConfig({
nodeModulesTransform: {
type: 'none',
},
routes: [
{ path: '/', component: '@/pages/index' },
],
"sass": { }, ///配这里
});
Ok。