forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrocfile.js
More file actions
38 lines (30 loc) · 1.1 KB
/
Copy pathBrocfile.js
File metadata and controls
38 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Build pipeline for Angular2.
* First time setup:
* $ npm install --global broccoli-cli
*/
var merge = require('merge');
var TraceurCompiler = require('./tools/broccoli/traceur');
var Funnel = require('broccoli-funnel');
var stew = require('broccoli-stew');
var _COMPILER_CONFIG_JS_DEFAULT = {
sourceMaps: true,
annotations: true, // parse annotations
types: true, // parse types
script: false, // parse as a module
memberVariables: true, // parse class fields
modules: 'instantiate'
};
var modulesTree = new Funnel('modules', {include: ['**/**'], destDir: '/'});
var transpiledTree = new TraceurCompiler(modulesTree, merge(true, _COMPILER_CONFIG_JS_DEFAULT, {
typeAssertionModule: 'rtts_assert/rtts_assert',
typeAssertions: true,
outputLanguage: 'es6'
}));
transpiledTree = stew.rename(transpiledTree, function(relativePath) {
return relativePath.replace(/\.(js|es6)\.map$/, '.map')
.replace(/\.js$/, '.es6');
});
transpiledTree = stew.mv(transpiledTree, 'js/dev/es6')
//transpiledTree = stew.log(transpiledTree);
module.exports = transpiledTree;