@@ -58,9 +58,10 @@ var sourceTypeConfigs = {
5858 compiler : function ( ) {
5959 return traceur ( js2dartOptions , true ) ;
6060 } ,
61- transpileSrc : [ 'modules/**/*.es6d ' ] ,
61+ transpileSrc : [ 'modules/**/*.js ' ] ,
6262 htmlSrc : [ 'modules/*/src/**/*.html' ] ,
63- copySrc : [ 'modules/**/*.dart' ] ,
63+ // TODO: execute pub get after a yaml changed and was copied over to 'build' folder
64+ copySrc : [ 'modules/**/*.dart' , 'modules/**/*.yaml' ] ,
6465 outputDir : 'build/dart' ,
6566 outputExt : 'dart' ,
6667 mimeType : 'application/dart'
@@ -69,9 +70,9 @@ var sourceTypeConfigs = {
6970 compiler : function ( ) {
7071 return traceur ( js2es5Options , true ) ;
7172 } ,
72- transpileSrc : [ 'modules/**/*.es* ' ] ,
73+ transpileSrc : [ 'modules/**/*.js' , 'modules/**/*.es6 '] ,
7374 htmlSrc : [ 'modules/*/src/**/*.html' ] ,
74- copySrc : [ 'modules/**/*.js ' ] ,
75+ copySrc : [ 'modules/**/*.es5 ' ] ,
7576 outputDir : 'build/js' ,
7677 outputExt : 'js'
7778 }
@@ -82,18 +83,25 @@ gulp.task('modules/clean', function() {
8283 . pipe ( clean ( ) ) ;
8384} ) ;
8485
86+ function renameSrcToLib ( file ) {
87+ file . dirname = file . dirname . replace ( / \b s r c \b / , 'lib' ) ;
88+ }
89+
8590function createModuleTask ( sourceTypeConfig , isWatch ) {
8691 var start = isWatch ? watch : gulp . src . bind ( gulp ) ;
8792 return function ( done ) {
8893 var transpile = start ( sourceTypeConfig . transpileSrc )
8994 . pipe ( rename ( { extname : '.' + sourceTypeConfig . outputExt } ) )
95+ . pipe ( rename ( renameSrcToLib ) )
9096 . pipe ( sourceTypeConfig . compiler ( ) )
9197 . pipe ( gulp . dest ( sourceTypeConfig . outputDir ) ) ;
9298 var copy = start ( sourceTypeConfig . copySrc )
99+ . pipe ( rename ( renameSrcToLib ) )
93100 . pipe ( gulp . dest ( sourceTypeConfig . outputDir ) ) ;
94101 // TODO: provide the list of files to the template
95102 // automatically!
96103 var html = start ( sourceTypeConfig . htmlSrc )
104+ . pipe ( rename ( renameSrcToLib ) )
97105 . pipe ( ejs ( {
98106 type : sourceTypeConfig . outputExt
99107 } ) )
0 commit comments