包裹中有多个捆

我正在寻找一种以以下格式在ParcelJS中捆绑多个组件的方法:

输入:

   -src 
   ----component1
   --------index.html
   --------main.ts
   --------class.ts

   ----component2
   --------index.html
   --------main.ts
   --------class.ts

输出:

   -dist
   ----component1
   --------index.html
   --------main.js

   ----component2
   --------index.html
   --------main.js

这可能吗?如果可以,可以在配置文件中定义它吗?

dong2apple 回答:包裹中有多个捆

您可以连续两次运行Parcel。假设在每个目录中,index.html是您的入口点,您可以执行以下操作:

parcel src/component1/index.html && parcel src/component2/index.html
本文链接:https://www.f2er.com/2760880.html

大家都在问