diff --git a/gulpfile.js b/gulpfile.js index 9a80dbed96..9fd03245b8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1123,11 +1123,11 @@ gulp.task('!bundle.copy', [ '!bundle.web_worker.js.dev.deps', '!bundle.js.sfx.dev.deps', '!router.bundle.js.dev' -], function () { - return merge2( - gulp.src('dist/js/bundle/*').pipe(gulp.dest('dist/js/prod/es5/bundle')), - gulp.src('dist/js/bundle/*').pipe(gulp.dest('dist/js/dev/es5/bundle'))); -}); +], + function() { + return merge2(gulp.src('dist/js/bundle/**').pipe(gulp.dest('dist/js/prod/es5/bundle')), + gulp.src('dist/js/bundle/**').pipe(gulp.dest('dist/js/dev/es5/bundle'))); + }); gulp.task('bundles.js', [ '!bundle.js.prod.deps', diff --git a/tools/broccoli/html-replace/SCRIPTS.html b/tools/broccoli/html-replace/SCRIPTS.html index 1566e0e9c6..70c7b59e7c 100644 --- a/tools/broccoli/html-replace/SCRIPTS.html +++ b/tools/broccoli/html-replace/SCRIPTS.html @@ -1,13 +1,23 @@ - - - - - - + + + + + + diff --git a/tools/broccoli/html-replace/SCRIPTS_benchmarks.html b/tools/broccoli/html-replace/SCRIPTS_benchmarks.html index a233374486..9993064e33 100644 --- a/tools/broccoli/html-replace/SCRIPTS_benchmarks.html +++ b/tools/broccoli/html-replace/SCRIPTS_benchmarks.html @@ -1,14 +1,22 @@ - - - - - - - + + + + + diff --git a/tools/broccoli/html-replace/SCRIPTS_benchmarks_external.html b/tools/broccoli/html-replace/SCRIPTS_benchmarks_external.html index 8562a130df..369576ce56 100644 --- a/tools/broccoli/html-replace/SCRIPTS_benchmarks_external.html +++ b/tools/broccoli/html-replace/SCRIPTS_benchmarks_external.html @@ -1,15 +1,14 @@ - - - - - - - - + + + + + + diff --git a/tools/broccoli/trees/browser_tree.ts b/tools/broccoli/trees/browser_tree.ts index 47f9515250..a541663411 100644 --- a/tools/broccoli/trees/browser_tree.ts +++ b/tools/broccoli/trees/browser_tree.ts @@ -90,9 +90,18 @@ module.exports = function makeBrowserTree(options, destinationPath) { }); var scriptPathPatternReplacement = { - match: '@@FILENAME_NO_EXT', + match: '@@PATH', replacement: function(replacement, relativePath) { - return relativePath.replace(/\.\w+$/, '').replace(/\\/g, '/'); + var parts = relativePath.replace(/\\/g, '/').split('/'); + return parts.splice(0, parts.length - 1).join('/'); + } + }; + + var scriptFilePatternReplacement = { + match: '@@FILENAME', + replacement: function(replacement, relativePath) { + var parts = relativePath.replace(/\\/g, '/').split('/'); + return parts[parts.length - 1].replace('html', 'js'); } }; @@ -171,7 +180,8 @@ module.exports = function makeBrowserTree(options, destinationPath) { files: ['examples*/**/*.html'], patterns: [ {match: /\$SCRIPTS\$/, replacement: htmlReplace('SCRIPTS')}, - scriptPathPatternReplacement + scriptPathPatternReplacement, + scriptFilePatternReplacement ] }); @@ -180,7 +190,8 @@ module.exports = function makeBrowserTree(options, destinationPath) { files: ['benchmarks/**'], patterns: [ {match: /\$SCRIPTS\$/, replacement: htmlReplace('SCRIPTS_benchmarks')}, - scriptPathPatternReplacement + scriptPathPatternReplacement, + scriptFilePatternReplacement ] }); @@ -188,10 +199,18 @@ module.exports = function makeBrowserTree(options, destinationPath) { files: ['benchmarks_external/**'], patterns: [ {match: /\$SCRIPTS\$/, replacement: htmlReplace('SCRIPTS_benchmarks_external')}, - scriptPathPatternReplacement + scriptPathPatternReplacement, + scriptFilePatternReplacement ] }); + // We need to replace the regular angular bundle with the web-worker bundle + // for web-worker e2e tests. + htmlTree = replace(htmlTree, { + files: ['examples*/**/web_workers/**/*.html'], + patterns: [{match: "/bundle/angular2.dev.js", replacement: "/bundle/web_worker/ui.dev.js"}] + }); + var assetsTree = new Funnel(modulesTree, {include: ['**/*'], exclude: ['**/*.{html,ts,dart}'], destDir: '/'});