Skip to content

Instantly share code, notes, and snippets.

@alexandervalencia
Last active May 14, 2018 18:24
Show Gist options
  • Save alexandervalencia/01e66c58cecbaad64f0aa15137840777 to your computer and use it in GitHub Desktop.
Save alexandervalencia/01e66c58cecbaad64f0aa15137840777 to your computer and use it in GitHub Desktop.
liferay-theme-typescript-hook/index.js
'use strict';
var path = require('path');
var ts = require('gulp-typescript');
var tsProject = ts.createProject('tsconfig.json');
module.exports = function(gulp, options) {
var runSquence = require('run-sequence').use(gulp);
var pathBuild = options.pathBuild;
gulp.task('typescript:compile', function() {
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest(path.join(pathBuild, 'js')));
});
gulp.hook('after:build:src', function(done) {
runSquence(
'typescript:compile',
done
);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment