Mapping file paths in jspm v0.17 beta

16 views
Skip to first unread message

Neville Franks

unread,
Sep 5, 2016, 4:29:46 AM9/5/16
to jspm
In JSPM 0.16 I could use:   
paths: {
  "some_js_file": "some_path/some_js_file.js"
  ...
}

to map js files to a file in a directory. This will works in the latest 0.17 beta 28 however when I try and 'bundle' all the files up it isn't working. I've tried creating a jspm.browser.js file and moving the paths{} there but that still doesn't work.

I've read the Beta Guilde http://jspm.io/0.17-beta-guide/index.html and looked at the Demo and Google searched all to no avail. In fact I can't find much in the way of documentation for jspm.browser.js or the changes from config.js in v0.16 to the two new config files in v0.17

Guy Bedford

unread,
Sep 6, 2016, 7:51:26 AM9/6/16
to Neville Franks, jspm
When building paths, they are reversed in the bundle output - so the dependency in the bundle output will be via System.register("some_js_file", ...) and not System.register("some_path/some_js_file.js", ...

In order for the normalizations to work out correctly it's important the paths configuration is present in the production environment before the bundle itself is loaded.

To debug bundling carefully try inspecting `Object.keys(System.defined)` to see what modules have been defined by the bundle, and why they aren't matching up with `System.normalizeSync('some_js_file')`.

--
You received this message because you are subscribed to the Google Groups "jspm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jspm-io+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages