PARCELJS V2将React文件构建到没有CSS的单个文件中
以前,在 Parcel V1 中,当我运行 parcel build src/results/results.js --out-file results.min.js --dist-dir src/theme/assets/
时,Parcel 会捆绑我的结果文件到 results.min.js
中,出于某种未知的原因,他们删除了此功能。
现在,当我删除 --out-file
参数时,它会捆绑为 results.js
并且还会生成随机 results.css
- 这似乎来自我正在使用的 node_module,并导入到我的主样式表中 - 我的样式是在 Parcel 外部处理的,因此该文件正在清除我自己的 CSS 文件。我似乎无法找到一种方法来阻止它这样做。
我在 Shopify 主题中使用它,因此我有多个 React 文件,这些文件旨在构建到它们自己的单独文件中。
Previously, in Parcel V1, when I ran parcel build src/results/results.js --out-file results.min.js --dist-dir src/theme/assets/
, Parcel would bundle my results file into results.min.js
, for some unknown reason, they've removed this functionality.
Now, when I remove the --out-file
argument, it bundles as results.js
and a random results.css
is also being produced - this seems to be coming from a node_module I'm using, and importing into my main stylesheet - my styles are handled outside of Parcel so this file is wiping out my own CSS file. I can't seem to find a way to prevent it from doing this.
I'm using this within a Shopify theme so I have multiple React files that are intended to build into their own individual files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论