You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed a limitation in the fileExclusionRegExp configuration option.
I'm using "Optimizing a Whole Project"-style compilation with a number of modules, and I'm having trouble specifying the set of files I'd like to copy over to the build directory.
Here's a simplified directory listing of my project:
During compilation, I would like a, b and c to be copied over but I'd like to ignore d.js as it is not intended for distribution.
I tried fileExclusionRegExp: /^scripts$/, but that excludes all 4.
I tried fileExclusionRegExp: /tools\/scripts/, but that excludes none of the 4.
I've tried a few more similar permutations, but I couldn't figure out a way to include all files in /app/scripts without the files in /tools/scripts.
The Workaround
The only workaround I've been able to find is to rename /tools/scripts to something different. This feels kludgy to me; why shouldn't fileExclusionRegExp support multiple files or directories with the same name?
Potential Solutiosn
Some solutions come to mind, such as executing the provided RegExp on relative project paths (i.e. /app/scripts/a.js instead of scripts and a.js). Another idea would be to reinstate functionality for excluding particular directories.
Thanks!
The text was updated successfully, but these errors were encountered:
I can see where a kind of fullPathExclusionRegExp might be useful. Although, r.js cannot do all the kinds of exclusions a developer may want, and relying on post-r.js build processes are still suggested for maximum flexibility.
Putting this in the 2.2.0 bucket for consideration.
What, exactly do you mean by post-r.js build processes? Is that essentially a script that goes through my r.js build directory and deletes unnecessary files?
@jrburke I also find that it would be very useful to be able to be able to use more flexible regular expressions. In projects, which have bower_components with hundreds of dependencies, developers have to be extra careful with what they exclude from the build. Being able to use something like that would be extremely beneficial for build time. Thank you.
Hi there!
I've noticed a limitation in the
fileExclusionRegExp
configuration option.I'm using "Optimizing a Whole Project"-style compilation with a number of modules, and I'm having trouble specifying the set of files I'd like to copy over to the build directory.
Here's a simplified directory listing of my project:
The Problem
During compilation, I would like a, b and c to be copied over but I'd like to ignore d.js as it is not intended for distribution.
fileExclusionRegExp: /^scripts$/
, but that excludes all 4.fileExclusionRegExp: /tools\/scripts/
, but that excludes none of the 4.The Workaround
The only workaround I've been able to find is to rename /tools/scripts to something different. This feels kludgy to me; why shouldn't
fileExclusionRegExp
support multiple files or directories with the same name?Potential Solutiosn
Some solutions come to mind, such as executing the provided RegExp on relative project paths (i.e.
/app/scripts/a.js
instead ofscripts
anda.js
). Another idea would be to reinstate functionality for excluding particular directories.Thanks!
The text was updated successfully, but these errors were encountered: