forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): Migrate build.js.dev fully to broccoli.
The previous change did the ES6 transpile, now we add ES5. The sourcemaps are broken, but were also broken previously. We'll address that separately.
- Loading branch information
Showing
6 changed files
with
76 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var Funnel = require('broccoli-funnel'); | ||
var mergeTrees = require('broccoli-merge-trees'); | ||
var stew = require('broccoli-stew'); | ||
var TraceurCompiler = require('./tools/broccoli/traceur'); | ||
|
||
var modulesTree = new Funnel('modules', {include: ['**/**'], destDir: '/'}); | ||
|
||
// First, use Traceur to transpile original sources to ES6 | ||
var es6DevTree = new TraceurCompiler(modulesTree, '.es6', { | ||
sourceMaps: true, | ||
annotations: true, // parse annotations | ||
types: true, // parse types | ||
script: false, // parse as a module | ||
memberVariables: true, // parse class fields | ||
modules: 'instantiate', | ||
typeAssertionModule: 'rtts_assert/rtts_assert', | ||
typeAssertions: true, | ||
outputLanguage: 'es6' | ||
}); | ||
es6DevTree = stew.rename(es6DevTree, function(relativePath) { | ||
return relativePath.replace(/\.(js|es6)\.map$/, '.map').replace(/\.js$/, '.es6'); | ||
}); | ||
|
||
// Call Traceur again to lower the ES6 build tree to ES5 | ||
var es5DevTree = new TraceurCompiler(es6DevTree, '.js', {modules: 'instantiate', sourceMaps: true}); | ||
es5DevTree = stew.rename(es5DevTree, '.es6.map', '.js.map'); | ||
|
||
module.exports = mergeTrees([stew.mv(es6DevTree, 'js/dev/es6'), stew.mv(es5DevTree, 'js/dev/es5')]); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters