diff options
author | Alex Tatiyants <atatiyan@gmail.com> | 2016-01-03 17:17:48 -0800 |
---|---|---|
committer | Alex Tatiyants <atatiyan@gmail.com> | 2016-01-03 17:17:48 -0800 |
commit | 5310ac7d8eb1838a6297117bc7f9fca70291f46a (patch) | |
tree | 28f54b184cb85f04e6d6720dd03258f3728fedde /tools/tasks/build.js.dev.ts |
initial commit
Diffstat (limited to 'tools/tasks/build.js.dev.ts')
-rw-r--r-- | tools/tasks/build.js.dev.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/tasks/build.js.dev.ts b/tools/tasks/build.js.dev.ts new file mode 100644 index 0000000..dfe9539 --- /dev/null +++ b/tools/tasks/build.js.dev.ts @@ -0,0 +1,25 @@ +import {join} from 'path'; +import {APP_SRC, APP_DEST} from '../config'; +import {templateLocals, tsProjectFn} from '../utils'; + +export = function buildJSDev(gulp, plugins) { + let tsProject = tsProjectFn(plugins); + return function () { + let src = [ + join(APP_SRC, '**/*.ts'), + '!' + join(APP_SRC, '**/*_spec.ts') + ]; + + let result = gulp.src(src) + .pipe(plugins.plumber()) + // Won't be required for non-production build after the change + .pipe(plugins.inlineNg2Template({ base: APP_SRC })) + .pipe(plugins.sourcemaps.init()) + .pipe(plugins.typescript(tsProject)); + + return result.js + .pipe(plugins.sourcemaps.write()) + .pipe(plugins.template(templateLocals())) + .pipe(gulp.dest(APP_DEST)); + }; +}; |