Requirejs optimize tool exclude folders

前端 未结 2 1200
春和景丽
春和景丽 2020-12-30 01:54

I am trying to optimize a project with r.js and am confused about how to exclude a certain folder from the copy step. My structure is...

/index.htm
/scripts/main

2条回答
  •  爱一瞬间的悲伤
    2020-12-30 02:37

    Yes, the documentation provides you with several ways of doing this:

    1. for a start only the dependencies listed in main.js's require and their own dependencies will be included.
    2. Assuming that what you have in /other/ is a dependency but you still don't want them in, you can use shallow exceptions, or define them in the require.js config paths and use the empty: scheme.

提交回复
热议问题