Closed klausbayrhammer closed 8 years ago
Can you clarify why you think nodir: true
is not the solution here? It sounds like that is exactly the problem at least?
Maybe you're right - if you specify your globs correctly it shouldn't be a problem at all. I was just thinking of cases where you specify something like app/**/*
and all the directories would be added to the bundle config.
But if it's as easy as changing the nodir
option I'm totally satisfied :)
Right so the intention is to exclude directories themselves from the glob results, but we still want globbing to glob directory variations like glob('dir*/*.js')
? to include the directory variations. I would have though the normal glob even with nodir: true would have expanded these already? Is that definitely not the case?
Given the following directory structure
app
|- x
| |- x.js
|- y
The following globs produce following results:
glob('a*/**/*', {nodir:false}) -> [ 'app/x', 'app/x/x.js', 'app/y' ]
glob('a*/**/*', {nodir:true}) -> [ 'app/x/x.js']
I'm pretty sure that the second option is way better for most people and that this should stay the default. Anyway it would may be an option to add a parameter to the bundling command whether the globs should expand to directories as well? That way you have an elegant way of excluding/including directories in you bundle config, but then you have to make sure that your globs are correct.
FYI - Our solution for now is to expand the globs ourselves and use the expanded globs without wildcards for constructing our bundles
I've added a fix in https://github.com/systemjs/builder/commit/7c7ff83a83bfd7575474b3859909d029802b1675 which I believe resolves this.
Released in 0.15.10.
Hi,
We are using a system-js plugin to resolve the URL of an import, which basically works like this:
This works totally fine as long as the app isn't bundled. When I bundle the app I tried to remove the imports which are using the url-resolver using the bundling arithmetics, which looks like this:
Unfortunately this didn't work and the
registry:myPkg@1.0.0/images!url
was added to the bundle config.Interesting thing is that the following config works and the dependency isn't added to the bundle config:
Same goes for importing (existing) files. If I change the import to
import urlToSpecificImage from '../images/play.svg!url'
and change the bundling expression toapp.js - [registry:myPkg*/images/*.svg!url]
everything works fine.For the sake of completeness the (pretty simple) url-plugin looks like this:
Is there a way how I can avoid that imported directories are bundled? Probably by changing the plugin's bundle function? Because I don't think changing the
nodir: true
in thearithmetic.js
is a solution - because you would have to exclude them in positive arithmentics and include them in negative arithmetics or something like that