systemjs

JSPM Bundle with TypeScript transpiler

泪湿孤枕 提交于 2019-12-20 10:56:07
问题 I'm getting more into System.js and JSPM, where I've come to the point where I want to bundle my TypeScript source code into a JavaScript bundle. Now I can bundle my generated JavaScript code with something like: jspm bundle some/source/path someDestFile.js but then I need to pre-build all my TypeScript first into JavaScript and then bundle, finding myself left with all the compiled (and seperated) JS files. This is far from ideal! I walked through the jspm docs here, but did not find a

How to run SystemJs module when view loads

两盒软妹~` 提交于 2019-12-20 07:28:51
问题 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

Angular2 + System.js - make all files load locally

自闭症网瘾萝莉.ら 提交于 2019-12-20 06:37:11
问题 I'm making Angular2 app, and the main HTML is this one: <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <link rel="stylesheet" type="text/css" href="css/index.css"> <title>App</title> <script src="./lib/traceur-runtime.js"></script> <script src="./lib/system.js"></script> <script src="./lib/angular2.dev.js"></script> </head> <body> <app></app> <script src="./js/bootstrap.js"></script> </body> </html> My goal is to make all files load locally. So - when I put those three files in the lib

SystemJS Typescript typing conflict

社会主义新天地 提交于 2019-12-20 06:29:05
问题 I'm currently in the process of looking into Angular2, coming from an AngularJS background. In that matter I'm also looking into SystemJS and Typescript. However, I've got an issue getting Angular2 running using Typescript typings and SystemJS. Using Typescript without any typings works as expected, but as soon as I try to load any modules from the Angular2 typing, SystemJS can't seem to resolve it. From what I've read, the typings are shipped with the angular2.dev.js, so as long as I import

Angular2 TypeScript transpiler with Minification / Uglify

馋奶兔 提交于 2019-12-20 05:18:06
问题 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? 回答1:

Barrel Import Appears To Break Load Order

我与影子孤独终老i 提交于 2019-12-20 02:57:07
问题 I've got a component that I'm trying to unit test but I keep getting these errors, depending on my import statements: Error: Cannot resolve all parameters for 'MyComponent'(undefined, FormBuilder). TypeError: Cannot read property 'toString' of undefined My component takes 2 parameters, one the FormBuilder and one a custom service, that must be injected: import {MyService} from '../'; @Component({ ..., providers: [MyService] }) class MyComponent { constructor(service: MyService, fb:

Create multiple bundles with Systemjs-builder for an Angular2 application

为君一笑 提交于 2019-12-19 08:52:14
问题 I have a working Angular2 application with the following structure: /app /components /moduleA /moduleB /... /shared app.module.ts app.routing.ts app.component.ts main.ts Now, I'm using systemjs-builder to create a single file with all my typescript, in my gulp file: gulp.task('bundle', () => { builder.buildStatic('app/*.js', 'web/bundle.app.js') .then(function() { console.log('Build complete'); }) }) And then in my index.html for my application: <body> <app>Loading...</app> <!-- application

Require nodejs “child_process” with TypeScript, SystemJS and Electron

不想你离开。 提交于 2019-12-19 05:57:38
问题 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": { "target": "es5", "module": "system", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts

How to make it possible to use Typescript with SystemJS and Angular?

我们两清 提交于 2019-12-19 05:46:33
问题 I'm trying to make SystemJS work with Typescript, but they seem to conflict with each other. How can I take advantage of the autoloading from System.js without it conflicting with keywords on Typescript? using import / require makes Typescript using it's own way for loading and referencing files, although it translates export as module.exports = ... , it doesn't do the same for import Is it possible at all to achieve this or I'll have to wait for Typescript to support ES6 keywords? 回答1:

How to use momentjs in TypeScript with SystemJS?

心不动则不痛 提交于 2019-12-19 05:03:01
问题 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) /// <reference path="../../../typings/tsd.d.ts" /> import * as moment from "moment"; import * as _ from "lodash"; ... ... const now = (this.timestamp === 0) ? moment() : moment(this.timestamp); I get a " TypeError: moment is not a function " The