问题描述
几个月来,我一直试图让 Parcel 添加供应商前缀(这就像现在不可能实现的梦想)。有人告诉我 Parcel 2 可以正确执行此操作,但我仍然没有在生成的 css 文件中看到供应商前缀。其他一切似乎都运行良好。 它工作了一次,然后再也没有工作过,一次工作后我没有改变任何东西。
一定有办法做到这一点! 我猜这个问题与 postcss-modules 有关,但是如何?
我的 package.json:
{
"name": "static-boilerplate","version": "1.0.0","description": "Boilerplate for building static websites with Parcel","main": "index.html","scripts": {
"start": "parcel serve src/index.html -p 3000 --open","prebuild": "rm -rf dist/*","build": "parcel build src/index.html"
},"keywords": [
"parcel","boilerplate","static","website"
],"author": "Tom Tillistrand repo","license": "ISC","devDependencies": {
"@babel/eslint-parser": "^7.12.1","@babel/plugin-transform-runtime": "^7.13.10","@babel/preset-env": "^7.11.0","@babel/runtime-corejs2": "^7.13.10","@parcel/transformer-sass": "^2.0.0-nightly.621","autoprefixer": "^9.8.6","css-mqpacker": "^7.0.0","parcel": "^2.0.0-beta.1","postcss-custom-properties": "^11.0.0","postcss-modules": "^4.0.0","sass": "^1.26.10"
}
}
我的 .postcsssrc 文件: (我不确定是否使用“modules: true”,但目前这两种方法都不起作用)
{
"plugins": {
"autoprefixer": {
"grid": true
},"postcss-custom-properties": true,"css-mqpacker": true
}
}
我的 .babelrc 文件:
{
"plugins": [
[
"@babel/plugin-transform-runtime",{
"corejs": 2,"regenerator": true
}
]
]
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)