By treating paths as either folder or file mappings, this covers the full set of use cases.
Wildcards no longer make much sense to be used within a name, and are only really important for mapping folders of the form 'path/*': 'dest/*'. By replacing the former case with just 'path/': 'dest/' to indicate a folder mapping, we can entirely deprecate wildcards.
I would like to point out that there might be another use case for wildcards. For example, I've been using them to allow following
import Foo from 'mynamespace-somemodule/Foo'
import Bar from 'mynamespace-othermodule/Bar'
The config looks like this
System.config({
paths: {
"mynamespace*": "path/to/src/mynamespace*",
},
});
I've been planning to use this trick to allow developing a platform type base application as a standalone. The platform is then installed using JSPM to multiple instances of actual consumer applications. The folders structure differs between platform and consumer instances and this is where wildcards become handy.
Is there a benefit from deprecating the wildcards?
I'm currently having a debate with a coworker about how to have our guys path kendo, which looks like it will be affected by this issue:
http://docs.telerik.com/kendo-ui/third-party/systemjs
So far, I've created a package.json for kendo and have been providing access through the jspm-local plugin. But my coworker set kendo up using that path remap, and wants that to be the way to access things.
It seems like this issue would make kendo's remapping strategy not work. Is that correct?
I use the following config for Angular2 development:
System.config({
defaultJSExtensions: true,
map: {
'app': 'app/main'
},
packageConfigPaths: [
'./node_modules/@angular/*/package.json',
'./node_modules/*/package.json'
],
paths: {
'app/*': 'app/*',
'*': 'node_modules/*'
}
});
How would I accomplish this without wildcards (and without having to explicitly list all the modules)?
@barbastan this would just become something like:
baseURL: 'node_modules',
paths: {
'app/': './app/',
}
Implemented in 0.20.0-alpha.1.
I'm wondering if there's any alternative in SystemJS 0.20.* to the following:
paths: {
'rxjs*': 'node_modules/rxjs/bundles/Rx.min.js'
}
This redirects all rxjs requests to a single node_modules/rxjs/bundles/Rx.min.js file.
Using jspm v0.15.63, I ran into a problem trying to remove wildcards:
paths: {
"github:*": "jspm_packages/github/",
"npm:*": "jspm_packages/npm/"
},
changed it (and associated listings in "map" node) to:
paths: {
"github/": "jspm_packages/github/",
"npm/": "jspm_packages/npm/"
},
but now getting error:
err Error on fetch for npm:[email protected]/index.js at file:///C:/Projects/Arbor/CremationBasics/site_FED/npm:[email protected]/index.js
Loading jspm_packages/npm/[email protected]
Loading src/pricing.js
Error: ENOENT: no such file or directory, open 'C:\Projects\Arbor\CremationBasics\site_FED\npm:[email protected]\index.js'
at Error (native)
Does one need to run a reinstall or something?
Most helpful comment
I'm wondering if there's any alternative in SystemJS 0.20.* to the following:
This redirects all
rxjsrequests to a singlenode_modules/rxjs/bundles/Rx.min.jsfile.