我正在为我的学习项目使用包裹打包器并尝试为其创建构建。我也在使用 scss 文件。在 bundle.scss
我已经导入了我所有的 scss 文件。
和进口 bundle.scss
进入 App.js
.
所以在运行时 parcel build index.html
,我收到以下错误。
🚨 /src/style/bundle.scss:undefined:undefined: plugin is not a function
at LazyResult.run (/usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:288:14)
at LazyResult.asyncTick (/usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:212:26)
at /usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:254:14
at new Promise (<anonymous>)
at LazyResult.async (/usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:250:23)
at LazyResult.then (/usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:131:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxxxx complete: `parcel build index.html`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxxxx complete script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /.npm/_logs/2021-06-12T17_37_55_156Z-debug.log
我的项目结构src/
-App.js
-styles/
--bundle.scss
--app.scss
-index.html
任何建议对我来说都是真正的帮助,谢谢。
最佳答案
好像是 Parcel 的 nanocss
的一个 bug .我只能通过根本不缩小 css 来修复它,使用
parcel build --no-minify
关于reactjs - 包裹构建失败 `bundle.scss:undefined:undefined: plugin is not a function`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67951491/