Skip to content

Commit 3699705

Browse files
committed
chore(build): Remove traceur from build.
This removes traceur from the compilation step in broccoli. Broccoli now transpiles to es5 using the typescript compiler.
1 parent 195c5c2 commit 3699705

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

tools/broccoli/broccoli-typescript.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class DiffingTSCompiler implements DiffingBroccoliPlugin {
4141
this.tsOpts = Object.create(options);
4242
this.tsOpts.outDir = this.cachePath;
4343
this.tsOpts.target = (<any>ts).ScriptTarget[options.target];
44+
this.tsOpts.module = (<any>ts).ModuleKind[options.module];
4445
this.tsOpts.experimentalDecorators = true;
4546
this.rootFilePaths = options.rootFilePaths ? options.rootFilePaths.splice(0) : [];
4647
this.tsServiceHost = new CustomLanguageServiceHost(this.tsOpts, this.rootFilePaths,

tools/broccoli/trees/browser_tree.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ module.exports = function makeBrowserTree(options, destinationPath) {
8383
],
8484
destDir: '/'
8585
});
86+
87+
var es5ModulesTree = new Funnel('modules', {
88+
include: ['**/**'],
89+
exclude: [
90+
'**/*.cjs',
91+
'benchmarks/e2e_test/**'
92+
],
93+
destDir: '/'
94+
});
8695

8796
var scriptPathPatternReplacement = {
8897
match: '@@FILENAME_NO_EXT',
@@ -108,12 +117,20 @@ module.exports = function makeBrowserTree(options, destinationPath) {
108117
sourceRoot: '.',
109118
target: 'ES6'
110119
});
111-
112-
// Call Traceur to lower the ES6 build tree to ES5
113-
var es5Tree = transpileWithTraceur(es6Tree, {
114-
destExtension: '.js',
115-
destSourceMapExtension: '.js.map',
116-
traceurOptions: {modules: 'instantiate', sourceMaps: true}
120+
121+
// Use TypeScript to transpile the *.ts files to ES5
122+
var es5Tree = compileWithTypescript(es5ModulesTree, {
123+
allowNonTsExtensions: false,
124+
declaration: false,
125+
emitDecoratorMetadata: true,
126+
experimentalDecorators: true,
127+
mapRoot: '', // force sourcemaps to use relative path
128+
module: 'System',
129+
noEmitOnError: false,
130+
rootDir: '.',
131+
sourceMap: true,
132+
sourceRoot: '.',
133+
target: 'ES5'
117134
});
118135

119136
// Now we add a few more files to the es6 tree that Traceur should not see

tools/broccoli/trees/node_tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function makeNodeTree(destinationPath) {
3434
experimentalDecorators: true,
3535
declaration: false,
3636
mapRoot: '', /* force sourcemaps to use relative path */
37-
module: 'commonjs',
37+
module: 'CommonJS',
3838
noEmitOnError: true,
3939
rootDir: '.',
4040
rootFilePaths: ['angular2/traceur-runtime.d.ts', 'angular2/globals.d.ts'],

0 commit comments

Comments
 (0)