Skip to content

Add support for exclude in tsconfig. #637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dist/main/tsconfig/tsconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ function getProjectSync(pathOrSrcFile) {
var cwdPath = path.relative(process.cwd(), path.dirname(projectFile));
if (!projectSpec.files && !projectSpec.filesGlob) {
var toExpand = invisibleFilesGlob;
if (projectSpec.exclude) {
toExpand = toExpand.concat(projectSpec.exclude.map(function (exclude) { return '!' + exclude; }));
}
}
if (projectSpec.filesGlob) {
var toExpand = projectSpec.filesGlob;
Expand Down
4 changes: 4 additions & 0 deletions lib/main/tsconfig/tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ interface UsefulFromPackageJson {
*/
interface TypeScriptProjectRawSpecification {
compilerOptions?: CompilerOptions;
exclude?: string[]; // optional: An array of 'glob / minimatch / RegExp' patterns to specify directories / files to exclude
files?: string[]; // optional: paths to files
filesGlob?: string[]; // optional: An array of 'glob / minimatch / RegExp' patterns to specify source files
formatCodeOptions?: formatting.FormatCodeOptions; // optional: formatting options
Expand Down Expand Up @@ -384,6 +385,9 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
var cwdPath = path.relative(process.cwd(), path.dirname(projectFile));
if (!projectSpec.files && !projectSpec.filesGlob) { // If there is no files and no filesGlob, we create an invisible one.
var toExpand = invisibleFilesGlob;
if(projectSpec.exclude){
toExpand = toExpand.concat(projectSpec.exclude.map((exclude) => '!' + exclude));
}
}
if (projectSpec.filesGlob) { // If there is a files glob we will use that
var toExpand = projectSpec.filesGlob
Expand Down