Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronously processing bundles #19

Open
ericsvendsen opened this issue Feb 12, 2016 · 2 comments
Open

Synchronously processing bundles #19

ericsvendsen opened this issue Feb 12, 2016 · 2 comments

Comments

@ericsvendsen
Copy link

I'm trying to bundle my dependencies and app code separately using arithmetic, for example:

jspm({bundles: [
{ src: 'app.js - [app/**/*]', dst: 'deps.bundle.js' },
{ src: 'app.js - deps.bundle.js', dst: 'app.bundle.js'}
]}).pipe(gulp.dest('build'));

Since the file deps.bundle.js needs to be created first, I'm getting an error that it doesn't exist, presumably because those bundles are being processed asynchronously. I can make this work with two separate Gulp tasks, but I was curious if there was a way to make this work synchronously in just one task.

@buddhike
Copy link
Owner

Using the resulting bundles in bundle expressions is not supported. One way to work around this would be using negative globs.

app = ['app/**/*'];
deps = ['!app/**/*'];

@ericsvendsen
Copy link
Author

I tried using a negative glob, but the [module] syntax mentioned in the systemjs docs doesn't seem to allow this. Inserting an exclamation point before the glob causes systemjs to look for a file named *.js - not a pattern of *.js but rather an actual file. The syntax also doesn't allow for quotes around the glob.

I tried googling for a while and I can't find any other examples or documentation that would support negative globs in this context, unfortunately. Not saying it's impossible, just that I can't make it work for some reason.

Regardless, it's not a huge deal to split my bundling into two separate tasks. This is actually helpful since then during development it allows me to only rebundle my app code when a file is changed. Thanks for your help and for a great plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants