npm - postcss-nested 和 autoprefixer 不工作
问题描述
我在 webpack 中添加了 postCSS,还添加了 postcss-simple-vars、postcss-nested 和 autoprefixer。在 webpack.config.js 我这样编码:
const path = require("path");
module.exports = {
entry: "./app/assets/scripts/App.js", //Watch - Process and Bundel
output: {
//change the output path from main.js on dist to another that we want
filename: "bundled.js",
path: path.resolve(__dirname, "app"),
},
mode: "development", // to fix mode warning in terminal
watch: true,
module: {
rules: [
{
test: /\.css$/i,
use: [
"style-loader",
"css-loader",
{
loader: "postcss-loader",
options: {
postcssOptions: {
plugins: [
[
//"postcss-preset-env",
require("postcss-simple-vars"),
require("postcss-nested"),
require("autoprefixer"),
{
// Options
},
],
],
},
},
},
],
},
],
},
};
但只是 postcss-simple-vars 正在工作!我尝试删除所需,将插件移动到 postcss.config.js 并添加 postcss-preset-env 但即使 postcss-simple-vars 中断也没有任何改变。
有任何想法吗?
解决方案
推荐阅读
- ajax - 在完全下载 ReactJS Web 应用程序之前显示加载进度条?
- ruby - “which ruby”指向一个不存在的目录,我如何让它指向与“whereis ruby”相同的目录?
- python - 如何获取行不同的不同列
- javascript - 遍历复杂的嵌套json数组javascript
- logic - 如何在 Coq 中声明某种归纳类型的常量?
- python - 在python中重叠findall
- node.js - aws-sdk NodeJS 从环境变量中读取凭证
- pandas - 减去同一行和列中但在不同数据框文件中的值
- python - 用 Python 编写期货(asyncio)
- asp.net-core - 如何注入对特定 IHostedService 实现的引用?