小编ton*_*y-k的帖子

无法在 npm 脚本中正确配置 Autoprefixer

我正在尝试配置 PostCSS Autoprefixer 但它不起作用。style.prefix.css它应该在同一个“css”文件夹中输出新文件。请帮助我理解我的 npm 脚本/设置有什么问题

这是我的 package.json

{
  "name": "sb-demo-website",
  "version": "1.0.0",
  "description": "demo website",
  "main": "index.js",
  "scripts": {
    "sass": "node-sass-chokidar sass/main.scss css/style.css -w --recursive --skip-initial",
    "compile-sass": "node-sass-chokidar sass/main.scss css/style.comp.css",
    "prefix-css": "postcss css/style.comp.css -o css/style.prefix.css --use autoprefixer"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "author": "tk",
  "license": "ISC",
  "bugs": {
    "url": ""
  },
  "homepage": "",
  "browserslist": "last 3 versions",
  "devDependencies": {
    "autoprefixer": "^10.0.0",
    "node-sass": "^4.14.1",
    "node-sass-chokidar": "^1.5.0",
    "postcss": "^8.0.5",
    "postcss-cli": "^7.1.2"
  }
}
Run Code Online (Sandbox Code Playgroud)

这是我运行脚本时的输出:

$ npm …
Run Code Online (Sandbox Code Playgroud)

npm autoprefixer postcss npm-scripts

0
推荐指数
1
解决办法
1300
查看次数

标签 统计

autoprefixer ×1

npm ×1

npm-scripts ×1

postcss ×1