systemjs

How to compile an Angular2 TypeScript application to a single file?

浪尽此生 提交于 2019-12-03 09:36:33
问题 I realize that I can compile my application with tsc my_app.ts --target system and it will generate a SystemJS-wrapped file for each imported module, which is awesome, but it generates anonymous (nameless) functions, so I can't just concatenate them to a single file. I thought about making this question "how to compile TypeScript to named SystemJS modules", but my goal is just to compile my Angular2 app to a single file, SystemJS or not. 回答1: The --outFile option works with the --module

Using SystemJS and Webpack

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a solution built with Angular + Typescript + Webpack2 and I want to load dynamically some external modules that are known only at runtime. Since I can't use webpack to accomplish this task I'm exploring SystemJs. I was trying to require SystemJS but this causes the application to fail, as the execution flow hit let System = require('systemjs'); I get this error Cannot find module "." at webpackMissingModule (system.src.js:3893) [angular] at new SystemJSLoader$1 (system.src.js:3893) [angular] at index.js:23199:14 [angular] at Object.

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

感情迁移 提交于 2019-12-03 04:50:17
问题 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 here. After bundling my application and initial load of the website SystemJS throws error: Error: http://localhost:57462/app/app.bundle.js detected as register but didn't execute. The application works but the error in the console definitely is not a good

How do I build a single js file for AWS Lambda nodejs runtime

怎甘沉沦 提交于 2019-12-03 03:51:13
问题 We are working on a project/framework that aids in deploying and maintaining code in AWS Lambda. I want to build/bundle all node.js code for a lambda function into one js file because: Smaller codebases help with lambda cold start issues Lambda has code zip size limit of 50MB We don't want to create a custom bundler to do this because there are many options already out there (systemjs,browserify,webpack etc). HOWEVER we are concerned with issues with some node modules not playing well with

jspm / jQuery / TypeScript - module “jquery” has no default export

老子叫甜甜 提交于 2019-12-03 01:14:07
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: <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> System.import('main'); </script> main.ts: import $ from "jquery"; export class Application { constructor() { console.log($); } } The TypeScript won't compile because "Module 'jquery' has no default export. The generated config.js has the correct mapping: "jquery": "npm:jquery@2.2.0" When the module

How to compile an Angular2 TypeScript application to a single file?

最后都变了- 提交于 2019-12-02 23:53:31
I realize that I can compile my application with tsc my_app.ts --target system and it will generate a SystemJS-wrapped file for each imported module, which is awesome, but it generates anonymous (nameless) functions, so I can't just concatenate them to a single file. I thought about making this question "how to compile TypeScript to named SystemJS modules", but my goal is just to compile my Angular2 app to a single file, SystemJS or not. The --outFile option works with the --module option (for AMD and SystemJS) since TypeScript 1.8, so this can be done natively. Here's the changelog .

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

非 Y 不嫁゛ 提交于 2019-12-02 22:27:23
问题 When should I concat my Angular2 app, and when should I leave my SystemJS original approach (leaving different modules in different files)? 回答1: 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)

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

给你一囗甜甜゛ 提交于 2019-12-02 19:09:46
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 here . After bundling my application and initial load of the website SystemJS throws error: Error: http://localhost:57462/app/app.bundle.js detected as register but didn't execute. The application works but the error in the console definitely is not a good thing. I tested my configuration on empty project and the problem is present again so I think the

Angular2 + System.js - make all files load locally

*爱你&永不变心* 提交于 2019-12-02 13:27:23
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 folder - I saw in the network inspector that it can't load "es6-modules-loader@0.16.6.js" from there,

SystemJS Typescript typing conflict

廉价感情. 提交于 2019-12-02 11:58:10
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 that, I should be fine? The error has some similarity with https://github.com/systemjs/systemjs/issues