【发布时间】:2018-10-11 07:42:58
【问题描述】:
我们如何将 PostCSS 支持添加到 Vue cli 3(我使用的是 beta 7)?有插件吗?它不支持开箱即用。
当我尝试像这样导入时
import './index.pcss'
使用默认的cli生成项目
./src/index.pcss
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .sofa {
| font-family: "sofachrome", serif;
| }
@ ./src/main.js 5:0-22
我的 postcssrc.js:
module.exports =
{
'plugins': {
'autoprefixer': {},
'postcss-smart-import': {},
'postcss-custom-properties': {},
'postcss-nested': {}
}
}
【问题讨论】:
-
根据docs其实是默认支持的。
-
在我的情况下它不起作用@yuriy636,