我正在尝试构建一个简单的网络项目
\n项目结构是这样的
\n-src\n--index.html\n--index.js\n--style.css\npackage.json\nyarn.lock\nRun Code Online (Sandbox Code Playgroud)\n我用这个安装了parcel-bundler
\nyarn global add parcel-bundler
我运行包裹构建命令
\nparcel build src/index.html
但此日志后发生了错误
\nD:\\playground\\js\\sample>parcel build src/index.html\n\xc3\x97 D:\\playground\\js\\sample\\src\\style.css:undefined:undefined: plugin is not a function\n at LazyResult.run (C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:288:14)\n at LazyResult.asyncTick (C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:212:26)\n at C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:254:14 \n at new Promise (<anonymous>)\n at LazyResult.async (C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:250:23)\n at LazyResult.then (C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:131:17)\nRun Code Online (Sandbox Code Playgroud)\n我只是按照包裹官方文档的说明进行操作
\n我找不到解决方案
\n请帮我
\nrai*_*tic 16
为什么公认的答案是“把婴儿和洗澡水一起倒掉”?
Parcel-bundler 仍然可以工作,但它没有修复损坏的部分,而是被 Parcel 2 放弃,因为 Parcel 2不支持 Vue 2 SFC。
构建 Rails 6/Vue 2 应用程序并从 webpack(er) 转换为 Parcel,因此 Parcel 2 不适合我。(要求人们升级,然后不提供升级路径或像样的文档,让我想起了 webpack!)
parcel build ./app/packs/entrypoints/*.js --no-minify
这会禁用缩小,这至少消除了我的这个特定错误。
问题已解决:parcel-bundler 已弃用。使用“parcel”而不是“parcel-bundler”
| 归档时间: |
|
| 查看次数: |
10529 次 |
| 最近记录: |