About H5 project development in TS (or JS) file in order to compile a file of records

Due to execution of the characteristics js, js multiple files into one file or multiple files js loaded when needed in the order specified, otherwise the situation would appear an error.
We look at the current practices of several mainstream H5 engine.

Egret practice

The current version of practice

In tsconfig.json using a outDir instead outFile, so to speak only a single set ts ts files directly translated into the corresponding js file, never mind ts compiler fully loaded sequence js file.
Egret own compiler will resolve themselves ts file to determine the order of js file js file for loading and merge, the only drawback is that this approach will lead to time-consuming to compile.

The new version of practice

The new version also not out, only to find out through official below:
Probably means is employed ES2015 + webpack way to achieve a plurality of TS or JS files into a file in the correct order js.

Laya practice

1.x

Before the 2.0 Laya, I only used a short time, look no concrete realization, feel and egrets current version of the approach should be similar.

2.x

Use CommonJS way to develop, and added support browserify tsify to achieve CommonJS writing can be executed in the browser, these two libraries implement multiple TS files into a js file in the correct order.
browserify: http://browserify.org/

Cocos Creator

I know this engine than less, probably looked at, using the CommonJS, merged into a js file using technology is not very clear.

Guess you like

Origin www.cnblogs.com/hammerc/p/11264737.html