@@ -196,7 +196,7 @@ function errorWithDetails<T>(error: Error, details: T): Error {
196196
197197import fs = require( 'fs' ) ;
198198import path = require( 'path' ) ;
199- import expand = require( 'glob-expand ' ) ;
199+ import glob = require( 'glob' ) ;
200200import os = require( 'os' ) ;
201201import formatting = require( './formatting' ) ;
202202
@@ -212,7 +212,7 @@ var defaultFilesGlob = [
212212/**
213213 * This is what we use when the user doens't specify a files / filesGlob
214214 */
215- var invisibleFilesGlob = [ " **/*.ts" , " **/*.tsx" ] ;
215+ var invisibleFilesGlob = '{ **/*.ts, **/*.tsx}' ;
216216
217217export var defaults : ts . CompilerOptions = {
218218 target : ts . ScriptTarget . ES5 ,
@@ -390,18 +390,22 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
390390 // Our customizations for "tsconfig.json"
391391 // Use grunt.file.expand type of logic
392392 var cwdPath = path . relative ( process . cwd ( ) , path . dirname ( projectFile ) ) ;
393- if ( ! projectSpec . files && ! projectSpec . filesGlob ) { // If there is no files and no filesGlob, we create an invisible one.
394- var toExpand = invisibleFilesGlob ;
395- if ( projectSpec . exclude ) {
396- toExpand = toExpand . concat ( projectSpec . exclude . map ( ( exclude ) => `!${ exclude } /**` ) ) ;
397- }
398- }
399- if ( projectSpec . filesGlob ) { // If there is a files glob we will use that
400- var toExpand = projectSpec . filesGlob
393+ var filesGlob = invisibleFilesGlob ;
394+ var ignore = [ ] ;
395+
396+ if ( Array . isArray ( projectSpec . filesGlob ) ) {
397+ filesGlob = projectSpec . filesGlob . length === 1 ? projectSpec . filesGlob [ 0 ] : `{${ projectSpec . filesGlob . join ( ',' ) } }` ;
398+ } else if ( projectSpec . exclude ) {
399+ ignore = projectSpec . exclude . map ( path => `${ path } /**` )
401400 }
402- if ( toExpand ) { // Expand whatever needs expanding
401+
402+ if ( filesGlob ) { // Expand whatever needs expanding
403403 try {
404- projectSpec . files = expand ( { filter : 'isFile' , cwd : cwdPath } , toExpand ) ;
404+ projectSpec . files = glob . sync ( filesGlob , {
405+ cwd : cwdPath ,
406+ ignore : ignore ,
407+ nodir : true
408+ } ) ;
405409 }
406410 catch ( ex ) {
407411 throw errorWithDetails < GET_PROJECT_GLOB_EXPAND_FAILED_Details > (
0 commit comments