【发布时间】:2021-07-07 04:05:15
【问题描述】:
我正在使用 Parcel-bundler@1.12.3,通过 npm 安装。
我的 CSS 是通用的纯 CSS,没有任何模块或 SASS 或任何使用的东西。
“包裹索引.html”完美运行。
但是,当运行“parcel build index.html --no-content-hash --out-dir public --no-cache --no-source-maps --public-url ./”时,parcel 开始自动安装 postcss 和所有依赖项。然后抛出这个错误。
我已尝试禁用所有原始 CSS 并为我的 index.html 使用虚拟 CSS,但问题仍然存在。
test.css
body {
background-image: linear-gradient(90deg, #303133, #303133);
font-family: 'Open Sans', sans-serif;
font-weight: 200;
min-height: 100vh;
margin: 0;
color: #d3d3d3;
}
错误:
C:\Users...\frontend\styles\test.css:undefined:undefined: 插件不是函数 在 LazyResult.run (C:\Users...\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:288:14) 在 LazyResult.asyncTick (C:\Users...\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:212:26) 在 C:...\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:254:14 at new Promise () 在 LazyResult.async (C:\Users...\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:250:23) 在 LazyResult.then (C:\Users...\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:131:17)
【问题讨论】: