systemjs

When should I concat Angular2 App as opposite to SystemJS approach?

扶醉桌前 提交于 2019-12-02 11:17:19
When should I concat my Angular2 app, and when should I leave my SystemJS original approach (leaving different modules in different files)? It mainly depends on browser support. The old way, pre http2, was to bundle everything into one big file. Now that we have http2 on the way, it's no longer necessary depending on what browsers and servers you target. Please note that the server should be configured for http2 if you are serving many files, but both nginx and apache (with mod_http2) has http2 support, so you should be ok. Browser support: ~70% according to Can I use . 来源: https:/

How to run SystemJs module when view loads

江枫思渺然 提交于 2019-12-02 08:25:12
I have a component that loads a javascript module that builds on Bootstrap.js and Jquery to automatically build a table of contents for a page based on H1,H2,... headers. The component code is as follows: import { bindable, bindingMode, customElement, noView } from 'aurelia-framework'; @noView() @customElement('scriptinjector') export class ScriptInjector { @bindable public url; @bindable public isLocal; @bindable public isAsync; @bindable({ defaultBindingMode: bindingMode.oneWay }) protected scripttag; private tagId = 'bootTOCscript'; public attached() { if (this.url) { this.scripttag =

jest testing with es6 + jspm + systemjs + reactJS

守給你的承諾、 提交于 2019-12-02 07:39:17
I'm trying to figure out how to make my unit tests in my reactJS ES6 application. My application is already using es6 module system, transpiled with jspm/babel to systemJs. I found babel-jest as preprocessor but even with it, I can't run my tests because jest can't find SystemJs. ( "System is not defined" error is shown in the console) In the browser, as explained in jspm documentation, SystemJs is loaded globally. I guess I should load SystemJs inside my preprocessor, but How can I make systemJs available for loading additional modules in my tests? Thanks in advance Unfortunately, Jest does

Angular2 TypeScript transpiler with Minification / Uglify

梦想的初衷 提交于 2019-12-02 04:34:07
I'm developing a web application in Visual Studio 2015 with Angular2 and TypeScript . I'm using Gulp to generate distributed minified js files. With Angular2 I see, that there is no need to transpile TypeScript neither with Visual Studio nor with Gulp as SystemJs does it when importing the module. Now is the question: How does SystemJs work with minification, uglification and so on? System.import('app/main').then(null, console.error.bind(console)); How do I minify or uglify this? Thierry Templier SystemJS is Universal dynamic module loader - loads ES6 modules, AMD, CommonJS and global scripts

SystemJS and KarmaJS: TypeError: System.import is not a function

孤者浪人 提交于 2019-12-02 04:33:24
问题 I am trying to get my project working with Karma and SystemJS. I am using the karma-systemjs plugin with karma. I keep getting the error below about System.import. I believe it is because SystemJS is not being loaded by the time the karma-systemjs plugin runs. Please tell me what I am doing wrong. Project structure SystemJS configuration (system.conf.js) System.config({ baseUrl: '', defaultJSExtensions: true, map: { 'jquery': 'vendor/kendo/js/jquery.min.js', 'angular': 'vendor/kendo/js

SystemJS and KarmaJS: TypeError: System.import is not a function

浪尽此生 提交于 2019-12-02 01:05:49
I am trying to get my project working with Karma and SystemJS. I am using the karma-systemjs plugin with karma. I keep getting the error below about System.import. I believe it is because SystemJS is not being loaded by the time the karma-systemjs plugin runs. Please tell me what I am doing wrong. Project structure SystemJS configuration (system.conf.js) System.config({ baseUrl: '', defaultJSExtensions: true, map: { 'jquery': 'vendor/kendo/js/jquery.min.js', 'angular': 'vendor/kendo/js/angular.js', 'kendo': 'vendor/kendo/js/kendo.all.min.js', 'angular-mocks': 'vendor/bower_components/angular

Angular2: ng2-file-upload : cannot load it correctly using SystemJS

六眼飞鱼酱① 提交于 2019-12-01 21:24:40
I'm using systemJS to manage my packages so I've added those lines to my systemjs's configuration file : { map: { 'ng2-file-upload': 'node_modules/ng2-file-upload' }, packages: { 'ng2-file-upload': { main: './ng2-file-upload/ng2-file-upload.js', // also tried with './ng2-file-upload.js' defaultExtension: 'js' }, } } I import ng2-file-upload via import { FileDrop, FileUploader } from 'ng2-file-upload'; . But importing causes my application "craches" : my typscript compiler seems works well (I can see logs due to other code) but the modifications are not transpiled anymore so I can't run

Circular dependency with Angular 2 and SystemJS [duplicate]

浪尽此生 提交于 2019-12-01 20:47:32
This question already has an answer here: Can typescript external modules have circular dependencies? 2 answers I have a problem that I think is caused by a circular dependency. After some extensive research, I haven't been able to find a solution. It looks related to this issue : TypeError: b is undefined in __extends in TypeScript, but it didn't help me. I have been able to simplify the problem in this plunker . Basically there are 3 classes : the class A , that contains an array of A the class B , that inherits from A the class F , a factory that can create an A or a B depending on a value

(SystemJS) XHR error @angular/commobundles/common.umd.js/http not found

与世无争的帅哥 提交于 2019-12-01 18:50:01
I am making a simple http request in my application. I am using Angular 2 Quickstart and updating all my angular packages to 4.3.4 This is my package.json { "name": "angular-quickstart", "version": "1.0.0", "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": { "build": "tsc -p src/", "build:watch": "tsc -p src/ -w", "build:e2e": "tsc -p e2e/", "serve": "lite-server -c=bs-config.json", "serve:e2e": "lite-server -c=bs-config.e2e.json", "prestart": "npm run build", "start": "concurrently \"npm run build:watch\" \"npm run serve\"", "pree2e

Kendo UI Angular : (SystemJS) Unexpected token <

[亡魂溺海] 提交于 2019-12-01 18:18:05
I'm using VS2015 RC3, Angular2 2.0.0 on an ASP.NET Core solution using IIS. Whenever I try to add a new UI module such as dropdowns or inputs, I get a SystemJS error, but the weird thing is that my buttons work without any issue... master.module.ts : import { ButtonsModule } from '@progress/kendo-angular-buttons'; import { DropDownsModule } from '@progress/kendo-angular-dropdowns'; import { InputsModule } from '@progress/kendo-angular-inputs'; @NgModule({ imports: [ CommonModule, MasterRouting, ButtonsModule, // => Works fine and button is showing as expected InputsModule, // Error :