Questions tagged [systemjs]

Spec-compliant universal module loader - loads ES6 modules, AMD, CommonJS and global scripts.

Designed as a small collection of extensions to the ES6 specification System loader, which can be applied individually or all together.

Features include:

  • Core: Some small fixes to the spec loader behavior.
  • Formats: Dynamically load AMD, CommonJS and global scripts (as well as ES6 modules) - detecting the format automatically, or with format hints.
  • Map: Map configuration.
  • Versions: Multi-version support for semver compatible version ranges (@^1.2.3 syntax).
  • Plugins: A dynamic plugin system for modular loading rules.
  • Bundles: Dynamically link requires to bundle files.

Designed to work with the ES6 Module Loader polyfill (15KB minified) for a combined footprint of 27KB. In future, with native implementations, the ES6 Module Loader polyfill should no longer be necessary. As jQuery provides for the DOM, this library can smooth over inconsistiencies and missing practical functionality provided by the native System loader.

Runs in the browser and NodeJS.


Useful links

1398 questions
39
votes
9 answers

styleUrls not working in Angular 2

I'm using Angular 2 with SystemJS and trying to add a stylesheet to a component. Since I'm using SystemJS I can't use relative path as of now, so I used absolute path for the component's template url and also the style url. However inline style…
rakeen
  • 1,673
  • 2
  • 13
  • 22
33
votes
10 answers

Running Angular2 In Subdirectory

I have an app which runs fine under localhost. I tried to put it out on an IIS server today as a child application. So the new path would be localhost/SubDir. System.js pukes everywhere trying to load modules now. I set the basePath and played with…
Andrew Walters
  • 4,763
  • 6
  • 35
  • 49
31
votes
5 answers

How to import MongoDB using es6 style imports?

Hopefully this is a simple question. I am trying to import MongoDB using the es6 import-from style. If I import using node require it works fine. let mongo = require('mongodb'); let MongoClient = mongo.MongoClient; But if I import it the es6 way it…
micah
  • 7,596
  • 10
  • 49
  • 90
30
votes
8 answers

Import a module from string variable

I need to import a JavaScript module from an in memory variable. I know that this can be done using SystemJS and Webpack. But nowhere can I find a good working example nor documentation for the same. The documentations mostly talks of dynamic import…
Guru Kara
  • 6,272
  • 3
  • 39
  • 50
30
votes
1 answer

Debugging SystemJS module loading?

I'm having an incredibly hard time understanding the modules and need a way to debug my issues. Is there a way to enumerate modules and their exports using SystemJS? The config file seems like a poorly documented minefield. For modules that…
Jason Goemaat
  • 28,692
  • 15
  • 86
  • 113
29
votes
9 answers

Typescript module systems on momentJS behaving strangely

I'm trying to use momentJs from typescript: depending on what module system I'm using to compile typescript, I find a different behaviour on how I can use momentJs. When compiling typescript with commonJs everything works as expected and I can just…
nemenos
  • 877
  • 1
  • 10
  • 23
29
votes
1 answer

Can anyone explain what es7 reflect-metadata is all about?

Been studying ES6, JSPM & angular2 for a week now and I found this repo ES6-loader if we look at the index.html at the bottom script you'll see System.import('reflect-metadata') .then(function() { return System.import('app/index'); }) …
Armeen Moon
  • 18,061
  • 35
  • 120
  • 233
28
votes
2 answers

jspm / jQuery / TypeScript - module "jquery" has no default export

I'm trying to bootstrap a web app using TypeScript and jspm & system.js for module loading. I'm not getting very far. After installing jspm, and using it to install jQuery: jspm install jquery And the basics:
user888734
  • 3,797
  • 5
  • 36
  • 67
27
votes
4 answers

How to bundle Angular 2 Typescript app using Gulp and SystemJS?

I'm using Typescript with SystemJS for module loading and Gulp for task runner in my Angular 2 project. The current version of Angular in the project is RC2 but the problem is present also with RC1. I followed the steps of brando's answer…
Nikola Nikolov
  • 1,310
  • 2
  • 10
  • 20
27
votes
9 answers

How to use momentjs in TypeScript with SystemJS?

My project's setup includes 'jspm' tool for libraries and 'tsd' tool for typings. After installing moment's TypeScript d.ts file (these), I can't find a way to load and actually use a moment instance. In my file (using SystemJS module loading) ///…
dror
  • 3,759
  • 6
  • 31
  • 45
26
votes
4 answers

Angular 2 HTTP "Cannot resolve all parameters for 'AppService'"

I tried to import the http provider into a service, but I'm getting the following error: Cannot resolve all parameters for 'AppService'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that…
23
votes
1 answer

How do I get document injected into systemjs-builder for bundling a angular 4.0.0 app?

I'm trying to bundle an angular 4.0.0 app. I've tried browserify but the new angular-loader plugin (that allows for not needing the moduleId in components with templateUrl) does not get called and so the templates end up with the wrong path. So I…
Ricardo Gomes
  • 1,268
  • 2
  • 15
  • 35
23
votes
4 answers

Require nodejs "child_process" with TypeScript, SystemJS and Electron

I'm working on a simple nodejs electron (formerly known as atom shell) project. I'm writing it using angular 2, using the project the same project setup as they recommend in the documentation for typescript: tsc: { "compilerOptions": { …
Ziv Glazer
  • 786
  • 2
  • 8
  • 24
22
votes
2 answers

How can you bundle Angular 2 using System JS Builder?

I'm currently using System JS with System JS Builder to bundle up my application, its assets, and the libraries that it references. My problem is that I can bundle libraries that are referenced explicitly in the index.html, e.g:
user3452805
  • 1,511
  • 2
  • 11
  • 14
21
votes
1 answer

Build Angular2 HTML and TypeScript to a single file

I'm putting together an app (Large scale) using Angular2 and TypeScript. It will need to be divided into numerous projects and each project will have numerous components each with a .html view, .css stylesheet and .ts logic / class. I would like…
Stephen Wilson
  • 1,484
  • 1
  • 15
  • 30
1
2
3
93 94