Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

While there is a lot of questionsquestions and documentation on SystemJS, I still don't understand the import syntax. Specifically, why can typescript not find ng-boostrap.js using this code:

import { createPlatform } from '../../node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap',

which is directly importing the file, but this code works:

import {createPlatform } from './node_modules/@angular/core/bundles/core.umd.js';

where my map in systemjs.config.js contains the line:

'@angular/core': 'npm:@angular/core/bundles/core.umd.js'.

Why I can not import directly from node_modules using systemJS?

While there is a lot of questions and documentation on SystemJS, I still don't understand the import syntax. Specifically, why can typescript not find ng-boostrap.js using this code:

import { createPlatform } from '../../node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap',

which is directly importing the file, but this code works:

import {createPlatform } from './node_modules/@angular/core/bundles/core.umd.js';

where my map in systemjs.config.js contains the line:

'@angular/core': 'npm:@angular/core/bundles/core.umd.js'.

Why I can not import directly from node_modules using systemJS?

While there is a lot of questions and documentation on SystemJS, I still don't understand the import syntax. Specifically, why can typescript not find ng-boostrap.js using this code:

import { createPlatform } from '../../node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap',

which is directly importing the file, but this code works:

import {createPlatform } from './node_modules/@angular/core/bundles/core.umd.js';

where my map in systemjs.config.js contains the line:

'@angular/core': 'npm:@angular/core/bundles/core.umd.js'.

Why I can not import directly from node_modules using systemJS?

Fixed title to reflect what is actually being asked. The original question in the title was too broad.
Source Link
Louis
  • 152.3k
  • 28
  • 287
  • 332

What does SystemJS do on Why I can not import directly from node_modules using SystemJS?

While there is a lot of questions and documentation on SystemJS, I still don't understand the import syntax. Specifically, why can typescript not find ng-boostrap.js using this code:

import { createPlatform } from '../../node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap',

which is directly importing the file, but this code works:

import {createPlatform } from './node_modules/@angular/core/bundles/core.umd.js';

where my map in systemjs.config.js contains the line:

'@angular/core': 'npm:@angular/core/bundles/core.umd.js'.

Why I can not import directly from NodeModulesnode_modules using systemJS?

What does SystemJS do on import?

While there is a lot of questions and documentation on SystemJS, I still don't understand the import syntax. Specifically, why can typescript not find ng-boostrap.js using this code:

import { createPlatform } from '../../node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap',

which is directly importing the file, but this code works:

import {createPlatform } from './node_modules/@angular/core/bundles/core.umd.js';

where my map in systemjs.config.js contains the line:

'@angular/core': 'npm:@angular/core/bundles/core.umd.js'.

Why I can not import directly from NodeModules using systemJS?

Why I can not import directly from node_modules using SystemJS?

While there is a lot of questions and documentation on SystemJS, I still don't understand the import syntax. Specifically, why can typescript not find ng-boostrap.js using this code:

import { createPlatform } from '../../node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap',

which is directly importing the file, but this code works:

import {createPlatform } from './node_modules/@angular/core/bundles/core.umd.js';

where my map in systemjs.config.js contains the line:

'@angular/core': 'npm:@angular/core/bundles/core.umd.js'.

Why I can not import directly from node_modules using systemJS?

Source Link
Elliott Beach
  • 11.7k
  • 10
  • 32
  • 44

What does SystemJS do on import?

While there is a lot of questions and documentation on SystemJS, I still don't understand the import syntax. Specifically, why can typescript not find ng-boostrap.js using this code:

import { createPlatform } from '../../node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap',

which is directly importing the file, but this code works:

import {createPlatform } from './node_modules/@angular/core/bundles/core.umd.js';

where my map in systemjs.config.js contains the line:

'@angular/core': 'npm:@angular/core/bundles/core.umd.js'.

Why I can not import directly from NodeModules using systemJS?