angular - Specifying module locations in NPM tsc compiler -


the context

i have angular 2 app that, organizational purposes, store across 3 different repositories, example 1 reusable widgets, working app users should see, other users should see, etc. don't want these minified in production, involve delivering end user lots of code isn't pertinent them. rather, want each app minified, , requested end working app when needed.

the problem

i need specify component names rather absolute paths when import components in code. example:

import { mycomponent } '../../other-repo/app/components/my.component/my.component'; 

will have different in production, refer minified file repo in. able use module paths like

import { mycomponent } 'otherrepo.mycomponent'; 

staying close possible heroes tutorial set up, systemjs.config.js can told mycomponent setting property in map property:

var map = {   'app':  'app', // 'dist',   'otherrepo.mycomponent': '../../other-repo/app/components/my.component',   ... } 

in theory, set build process using grunt, gulp, or similar, turn file template contains different paths depending on whether it's dev or prod build.

the problem npm tsc compiler. configuration works fine when i'm running app , let reload. when running npm tsc compiler when first begin running app, complains can't find mycomponent. i've tried adding things tsconfig.json file:

"paths": {   "mycomponent": "../../other-repo/app/component/my-component" } 

both inside , outside of compileroptions block, doesn't work. i've tried naming property map instead, doesn't work. unfortunately, way working seems to change moduleresolution property classic rather node, won't able things import { component } '@angular/core';

is there way configure npm's tsc compiler allow me specify module locations?


Comments