steal
steal copied to clipboard
Follow path overrides for node_modules
The way in which StealJS resolves packages is somewhat atypical, and gets in the way of doing requires that aren't prefixed.
Generally, projects will have their dependencies in an assets/lib/src folder. If this folder is set as the baseURL, then doing something like require('foo') should load ./assets/foo.js unless explicitly mapped elsewhere. If this where in fact an install dependency, then the path would resolve to ./assets/node_modules/foo.js. The trick to making this work properly is then to override the path of node_modules, like such:
System.config({
baseURL: "assets",
paths: {
"node_modules": "../node_modules"
}
});
This would also remove the need for the #277, as packages would resolve to the proper paths without any additional syntax.