jspm

Angular2 + Jspm.io : reflect-metadata shim is required when using class decorators

爷,独闯天下 提交于 2019-11-27 13:23:42
问题 I am having the following problem running the below versions of JSPM with Angular2 and SystemJS (Versions: Angular@2.0.0-alpha.27 with JSPM@0.16.0-beta.2 and SystemJS@0.18.0) That once the typescript is compiled (without errors) i get the following error in the browser: /jspm_packages/npm/angular2@2.0.0-alpha.27/src/util/decorators.js:70 Uncaught reflect-metadata shim is required when using class decorators Now when i manually include the file Reflect.js: \jspm_packages\npm\reflect-metadata@0

How can moment.js be imported with typescript?

余生颓废 提交于 2019-11-27 09:10:56
I'm trying to learn Typescript. While I don't think it's relevant, I'm using VSCode for this demo. I have a package.json that has these pieces in it: { "devDependencies": { "gulp": "^3.9.1", "jspm": "^0.16.33", "typescript": "^1.8.10" }, "jspm": { "moment": "npm:moment@^2.12.0" } } Then I have a Typescript class main.js like this: import moment from 'moment'; export class Main { } My gulpfile.js looks like this: var gulp = require('gulp'); var typescript = require('gulp-tsb'); var compilerOptions = { "rootDir": "src/", "sourceMap": true, "target": "es5", "module": "amd", "declaration": false,

SystemJS: Why am getting error jquery_1.default is not a function when importing jquery

廉价感情. 提交于 2019-11-27 06:43:16
问题 I have installed foundation via jspm install foundation, then import foundation and jquery. The problem I am having is that if I import jquery via import $ as 'jquery' I get the error jquery_1.default is not a function. If I import jquery via import * as $ from jquery it works as expected I am calling $(document).foundation(); to initialize foundations javascript components. Below is my main.ts import 'foundation' import $ from 'jquery'; import {Aurelia} from 'aurelia-framework'; export

Angular 2: Reduce app size (in addition to bundling/minification)

♀尐吖头ヾ 提交于 2019-11-27 03:25:24
问题 I have a small-medium size (~28 KB including just the (TypeScript transpiled) JS + HTML templates) Angular 2 app. It's based originally on the angular.io quickstart, but now I am bundling/minifying it using JSPM for deployment. The bundled JS file I get is 2.1 MB, coming down to 449 KB when served with gzip compression. This is still rather large, and I would like to ask how best to go about reducing the overall size of the app for deployment, to deliver my app in the smallest and most

How can moment.js be imported with typescript?

流过昼夜 提交于 2019-11-26 14:25:52
问题 I'm trying to learn Typescript. While I don't think it's relevant, I'm using VSCode for this demo. I have a package.json that has these pieces in it: { "devDependencies": { "gulp": "^3.9.1", "jspm": "^0.16.33", "typescript": "^1.8.10" }, "jspm": { "moment": "npm:moment@^2.12.0" } } Then I have a Typescript class main.js like this: import moment from 'moment'; export class Main { } My gulpfile.js looks like this: var gulp = require('gulp'); var typescript = require('gulp-tsb'); var