If you look at the Angular2 formula tutorial 3, you will find the following four .ts files.
For example, if you look at app.component.ts
, you can import it as follows:
import {Hero} from './hero';
import {HeroDetailComponent} from './hero-detail.component';
Of course, there is no problem to compile individually as *.ts with gulp, but what should I do if I want to compile it into a single .js file?
I would like to reduce HTTP requests by loading them all together.
TypeScript 1.8 will be able to combine AMD and system modules into one file, but it is still not possible, so it will be summarized by compiling the module with commonjs and using browserify.
//tsconfig.json
{
"compilerOptions": {
"target": "ES5",
"module": "system",
...
$ npm ibrowserify
$ npm runtsc
$ ./node_modules/.bin/browserify app/boot.js-o app/app.js
In tconfig.json, specify the output destination filename in the out
property of compiralOptions
to compile import or require resolved and combined.
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
582 PHP ssh2_scp_send fails to send files as intended
578 Understanding How to Configure Google API Key
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.