mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Initial state
This commit is contained in:
53
samples/angular/MusicStore/gulpfile.js
vendored
Executable file
53
samples/angular/MusicStore/gulpfile.js
vendored
Executable file
@@ -0,0 +1,53 @@
|
||||
/// <binding AfterBuild='build' Clean='clean' />
|
||||
|
||||
"use strict";
|
||||
|
||||
var path = require('path');
|
||||
var gulp = require('gulp');
|
||||
var del = require('del');
|
||||
var eventStream = require('event-stream');
|
||||
var typescript = require('gulp-typescript');
|
||||
var inlineNg2Template = require('gulp-inline-ng2-template');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
var project = require("./project.json");
|
||||
var webroot = "./" + project.webroot + "/";
|
||||
|
||||
var config = {
|
||||
libBase: 'node_modules',
|
||||
lib: [
|
||||
require.resolve('bootstrap/dist/css/bootstrap.css'),
|
||||
path.dirname(require.resolve('bootstrap/dist/fonts/glyphicons-halflings-regular.woff')) + '/**',
|
||||
require.resolve('traceur/bin/traceur-runtime.js'),
|
||||
require.resolve('es6-module-loader/dist/es6-module-loader-sans-promises.js'),
|
||||
require.resolve('reflect-metadata/Reflect.js'),
|
||||
require.resolve('systemjs/dist/system.src.js'),
|
||||
require.resolve('angular2/bundles/angular2.dev.js'),
|
||||
require.resolve('angular2/bundles/router.dev.js'),
|
||||
require.resolve('angular2/bundles/http.dev.js'),
|
||||
require.resolve('jquery/dist/jquery.js'),
|
||||
require.resolve('bootstrap/dist/js/bootstrap.js')
|
||||
]
|
||||
};
|
||||
|
||||
gulp.task('build.lib', function () {
|
||||
return gulp.src(config.lib, { base: config.libBase })
|
||||
.pipe(gulp.dest(webroot + 'lib'));
|
||||
});
|
||||
|
||||
gulp.task('build', ['build.lib'], function () {
|
||||
var tsProject = typescript.createProject('./tsconfig.json', { typescript: require('typescript') });
|
||||
var tsSrcInlined = gulp.src([webroot + '**/*.ts'], { base: webroot })
|
||||
.pipe(inlineNg2Template({ base: webroot }));
|
||||
return eventStream.merge(tsSrcInlined, gulp.src('Typings/**/*.ts'))
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(typescript(tsProject))
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(webroot));
|
||||
});
|
||||
|
||||
gulp.task('clean', function () {
|
||||
return del([webroot + 'lib']);
|
||||
});
|
||||
|
||||
gulp.task('default', ['build']);
|
||||
Reference in New Issue
Block a user