How to build assets separately from the rest of the app with Parcel

扶醉桌前 提交于 2021-01-02 19:01:21

问题


I have a project that I am building with parcel. Since it is mostly static, I only have some files that should be updated once a day, I put the project on aws s3 bucket. I am thinking of updating the files that should be updated once a day, with a lambda function. But, in my project that is structured like this:

src/
   assets/
   components/
   main.js
   ...

In the folder assets, I have two other folders data and icons. Data folder holds json files that should be updated once a day.

assets/data/
      /icons/

When I run parcel to build a project, I see that all files inside icons folder are built as individual files.

How can I make files inside the data folder to build separately so that I know which files I need to target in order to update them?


回答1:


I found this package parcel-plugin-static-files-copy that does exactly what I need. Only had to add this to my package.json:

"staticFiles": {
  "staticPath": "src/assets/data"
}


来源:https://stackoverflow.com/questions/61839773/how-to-build-assets-separately-from-the-rest-of-the-app-with-parcel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!