systemjs

Using moment.js in Angular 2 typescript application

感情迁移 提交于 2020-01-22 17:44:26
问题 I'm struggling in using moment.js library inside an Angular 2 Typescript app. Even after reading the answer to this question I can't get it to work. This is what I did so far: I installed moment.js using npm, so I can find the library under node_modules/moment/moment.js I configured System.js to retrieve moment library: System.config({ packages: { app: { format: 'register', defaultExtension: 'js' }, moment: { main: 'moment.js', type: 'cjs', defaultExtension: 'js' } }, map: { moment: 'node

jest testing with es6 + jspm + systemjs + reactJS

情到浓时终转凉″ 提交于 2020-01-22 03:02:28
问题 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

Uncaught TypeError: Illegal constructor at DRE

◇◆丶佛笑我妖孽 提交于 2020-01-15 11:36:11
问题 index.html <!DOCTYPE html> <html> <head> <title>Angular QuickStart</title> <base href="/"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="https://unpkg.com/onsenui@2.0.0/css/onsenui.css"> <link rel="stylesheet" href="https://unpkg.com/onsenui@2.0.0/css/onsen-css-components.css"> <script src="https://unpkg.com/onsenui@2.0.0/js/onsenui.js"></script> <!-- Polyfill(s) for older

How to configure karma and systemjs to run tests for angular ES6 transpiled by traceur into amd format ES5 modules

て烟熏妆下的殇ゞ 提交于 2020-01-15 07:27:08
问题 Ok, I have been pounding my head against the desk for far too long, it is time to ask for help. Maybe I am way off base, or I just cannot see the trees in the forest. Please help. I am trying to build an application using gulp, Angular 1.3+, ES6, traceur, SystemJS, es_module_loader and http-server. So far the app is looking good, it compiles and runs and hosts just fine from the compiled folder location, but I cannot get Karma to run a single test within my compiled project. Here is my

Load combined modular typescript file with SystemJS

有些话、适合烂在心里 提交于 2020-01-15 01:49:30
问题 I have been following the basic Angular2 implementation. With TypeScript v1.8 it should be possible to use system module with outfile so we can generated a combined file instead of multiple javascript files. I have a problem with SystemJS trying to load the combined file as I don't know exactly what parameters it needs (I've tried various combinations...) but I don't get any console errors and AngularJS isn't initialized. This is the transpiled outfile var __decorate = (this && this._

“ Cannot read property 'resolve' of undefined” error

为君一笑 提交于 2020-01-07 03:48:05
问题 I try to use SystemJS to load modules that were previously compiled into ES5. I have the following error but I don't know how to interpret the error message: Error: Cannot read property 'resolve' of undefined(…) Promise.reject (async) g @ system.src.js:4597(anonymous function) @ system.src.js:4597 y @ system.src.js:4597 w @ system.src.js:4597 p @ system.src.js:4597 h @ system.src.js:4597 (anonymous function) @ system.src.js:4597 Here is the configuration within my HTML file: <script src=

System js map doesn't work

泄露秘密 提交于 2020-01-06 16:24:02
问题 Maybe I am dumb but system js always gives so much pain, although its so nice that I don't want to use anything else. My system js config is this: System.config({ packages: { app: { format: 'register', defaultExtension: 'js' }, primeng:{ format: 'register', defaultExtension: 'js' } }, map: { primeng: 'node_modules/primeng' } }); Primeng is being imported like this: import {Accordion} from "primeng/primeng"; import {AccordionTab} from "primeng/primeng"; This is a ts file which gets compiled in

Angular 2 keeps adding “/testing” to the end of my file imports - systemjs

末鹿安然 提交于 2020-01-05 05:35:10
问题 I've just started to add unit tests to my angular 2 app and I am having a nightmare, every time I have to import something new into my app that I haven't used before, it adds "/testing" to the end of each import: eg: localhost:3002/node_modules/@angular/compiler/bundles/compiler.umd.js/testing 404 (Not Found) It is driving me nuts because I fix one of that error and then the same thing happens to another file import when I need to import something else. current full error: zone.js:1382 GET

How to consume TypeScript module:system export with systemjs in browser

流过昼夜 提交于 2020-01-04 12:23:10
问题 I’m trying to use systemjs, and I have exported this code with tsc: https://github.com/quantumjs/solar-popup/blob/master/package.json#L10 { "compilerOptions": { "module": "system", "target": "es5", "sourceMap": true, "outFile":"./build/solar-popup.js", "sourceRoot": "./src/SolarPopup.ts", "rootDir": "./src/" }, "exclude": [ "node_modules" ] } However then trying to consume it in the browser the imported object doesn't contain any of the exports. I think this is due to the solar-popup.js not

How to consume TypeScript module:system export with systemjs in browser

南笙酒味 提交于 2020-01-04 12:23:08
问题 I’m trying to use systemjs, and I have exported this code with tsc: https://github.com/quantumjs/solar-popup/blob/master/package.json#L10 { "compilerOptions": { "module": "system", "target": "es5", "sourceMap": true, "outFile":"./build/solar-popup.js", "sourceRoot": "./src/SolarPopup.ts", "rootDir": "./src/" }, "exclude": [ "node_modules" ] } However then trying to consume it in the browser the imported object doesn't contain any of the exports. I think this is due to the solar-popup.js not