Skip to content

Instantly share code, notes, and snippets.

@Solomko2
Forked from kacpak/gulpfile.js
Created May 15, 2016 19:34
Show Gist options
  • Save Solomko2/768c38757139668dc3ff75b1694d9201 to your computer and use it in GitHub Desktop.
Save Solomko2/768c38757139668dc3ff75b1694d9201 to your computer and use it in GitHub Desktop.
Angular2 compilation
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var ts = require('gulp-typescript');
var tsProject = ts.createProject('tsconfig.json', {typescript: require('typescript')});
var paths = {
sass: ['./resources/sass/**/*.scss'],
ts: ['./resources/app/**/*.ts'],
css: './css',
}
gulp.task('sass', function () {
return gulp.src(paths.sass)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(paths.css));
});
gulp.task('ts', function() {
var tsResult = tsProject.src()
.pipe(ts(tsProject));
return tsResult.js.pipe(gulp.dest('./app'));
});
gulp.task('default', ['sass', 'ts']);
gulp.task('watch', function () {
gulp.watch(paths.sass, ['sass']);
gulp.watch(paths.ts, ['ts']);
});
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"rootDir": "resources/app/",
"outDir": "app/"
},
"exclude": [
"node_modules"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment