Skip to content

Commit

Permalink
Merge pull request #103 from vrockai/fixPath2
Browse files Browse the repository at this point in the history
Fixed async file paths adjusting in gulp script
  • Loading branch information
mtho11 committed Apr 30, 2015
2 parents a1628b0 + f98bb96 commit 81fe865
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 1 addition & 12 deletions build/gulpfile.js
Expand Up @@ -35,17 +35,6 @@ module.exports = function(gulp, config, pluginName){
var plugins = gulpLoadPlugins({});
var isWatch = false;

/** Adjust the reference path of any typescript-built plugin this project depends on */
gulp.task('path-adjust', function() {
gulp.src('libs/**/includes.d.ts')
.pipe(map(function(buf, filename) {
var textContent = buf.toString();
var newTextContent = textContent.replace(/"\.\.\/libs/gm, '"../../../libs');
return newTextContent;
}))
.pipe(gulp.dest('libs'));
});

gulp.task('clean-defs', function() {
del(['.tmp/' + pluginName + 'defs.d.ts']);
});
Expand Down Expand Up @@ -192,7 +181,7 @@ module.exports = function(gulp, config, pluginName){
// For directives
for(var i =0; i < watchList.length; i++) {
(function(plugin) {
plugins.watch(['libs/**/*.d.ts', config.ts(plugin), config.templates(plugin)], function () {
plugins.watch([config.ts(plugin), config.templates(plugin)], function () {
gulp.start(['tslint-watch-' + plugin, 'tsc-' + plugin, 'template-' + plugin, 'concat-' + plugin,
'clean-' + plugin, 'connect-prepare-dist-' + plugin]);
});
Expand Down
13 changes: 13 additions & 0 deletions gulpfile.js
Expand Up @@ -19,6 +19,7 @@ var gulp = require('gulp'),
del = require('del'),
wiredep = require('wiredep').stream,
plugins = require('gulp-load-plugins')({}),
map = require('vinyl-map'),
fs = require('fs'),
path = require('path');

Expand Down Expand Up @@ -65,6 +66,18 @@ for (var i = 0; i < pluginFolders.length; i++){
pluginBuildTasks.push('build-' + pluginName);
}

/** Adjust the reference path of any typescript-built plugin this project depends on */
gulp.task('path-adjust', function(done) {
gulp.src('libs/**/includes.d.ts')
.pipe(map(function(buf, filename) {
var textContent = buf.toString();
var newTextContent = textContent.replace(/"\.\.\/libs/gm, '"../../../libs');
return newTextContent;
}))
.pipe(gulp.dest('libs'))
.on('end', function() {done()});
});

gulp.task('reload', function() {
var staticPath = path.resolve(__dirname, '.tmp/gulp-connect-server/');

Expand Down

0 comments on commit 81fe865

Please sign in to comment.