我需要使用autoprefixing属性将我的scss编译为css文件 . 我的npm脚本如下所示:
{
"scripts": {
"build:css": "node-sass --output-style 'compressed' src/scss/ -o public_html/css/map/ && postcss --use autoprefixer public_html/css/map/ -d public_html/css/",
"watch:css": "node-sass --watch --recursive --output-style 'compressed' src/scss/ -o public_html/css/"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"node-sass": "^4.5.0",
"postcss": "^6.0.13",
"postcss-cli": "^4.1.1"
}
}
但是我收到一条错误消息:
插件错误:找不到模块'autoprefixer'
最后我认为我的代码很脏 . 我尝试使用node-sass生成css文件,并将它们放在filetree的“map”目录中 . 然后我尝试用postcss grab 它们并将autoprefixed css文件复制到css文件夹中 . 如果没有在 Map 目录中创建文件,有没有更清洁的方法?
1 回答
您需要安装npm模块:autoprefixer