From 5e83d5abaa1387926a0c6da4bc7d68982b8b4a35 Mon Sep 17 00:00:00 2001 From: Ivo Gabe de Wolff Date: Thu, 27 Oct 2016 21:59:04 +0200 Subject: [PATCH] Fix path issues with forward slashes on Windows --- lib/index.ts | 3 ++- lib/io.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 07d9a85..3b58868 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -5,6 +5,7 @@ import Vinyl = require('vinyl'); import chalk = require('chalk'); import project = require('./project'); +import { pathsEqual } from './io'; export import Project = project.Project; export import ProjectOptions = project.ProjectOptions; @@ -110,7 +111,7 @@ export function gulp(startFileName: string = 'index.js', options: GulpOptions = } fileNames.push(file.relative); - if (file.relative === startFileName) { + if (pathsEqual(file.relative, startFileName)) { gulpCompile(file); } }); diff --git a/lib/io.ts b/lib/io.ts index 18b5839..c3c9cad 100644 --- a/lib/io.ts +++ b/lib/io.ts @@ -19,7 +19,7 @@ interface VinylSourcemap extends Vinyl { export function normalizePath(path: string) { if (!path) return path; - return path.toLowerCase().replace(/\\/, '/'); + return path.toLowerCase().replace(/\\/g, '/'); } export function pathsEqual(a: string, b: string) { return normalizePath(a) === normalizePath(b);