Resolves SystemJS modules to an absolute path on the users file system.
npm install system-resolver
var systemResolver = require('system-resolver');
var pathToSystemConfig = 'system.config.js';
var resolvedPath = systemResolver(moduleName, pathToSystemConfig)
import systemResolver from 'system-resolver'
let pathToSystemConfig = 'system.config.js';
let resolvedPath = systemResolver(moduleName, pathToSystemConfig)
Given my current working directory is '/Users/JohnDoe/magic_app' the following code
system.config.js
System.config({
'paths': {
'stackTrace': 'node_modules/stacktrace-js/dist/stacktrace.js',
'babel': '../../../node_modules/babel-core/browser.js',
'babel-runtime/core-js/object/*': 'node_modules/babel-runtime/core-js/object/*.js',
'hammer': '../../../node_modules/hammerjs/hammer.js'
},
});
app.js
import systemResolver from 'system-resolver'
let pathToSystemConfig = 'system.config.js';
let resolvedPath = systemResolver(moduleName, pathToSystemConfig)
console.log(resolvedPath) //resolvedPath =
Will produce '/Users/JohnDoe/magic_app/node_modules/stacktrace-js/dist/stacktrace.js'
- Touch base by raise an issue first, don't want you to do unnecessary stuff
- Fork
- Start coding:
npm install
: to install dependenciesnpm run qualityAssurance
: to run jscs, jshint, test, to generate a coverage report, and check coveragenpm run compile
: to compile ES2015 code into ES5