-
Notifications
You must be signed in to change notification settings - Fork 130
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
WIP add useFileCompiler setting #616
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,17 +50,24 @@ export interface ProjectInfo { | |
reporter: Reporter; | ||
} | ||
|
||
export function setupProject(projectDirectory: string, configFileName: string, rawConfig: any, config: TsConfig, options: ts.CompilerOptions, projectReferences: ReadonlyArray<ts.ProjectReference>, typescript: typeof ts, finalTransformers: FinalTransformers) { | ||
export function setupProject(projectDirectory: string, configFileName: string, rawConfig: any, config: TsConfig, options: ts.CompilerOptions, projectReferences: ReadonlyArray<ts.ProjectReference>, typescript: typeof ts, finalTransformers: FinalTransformers, useFileCompiler: boolean | undefined) { | ||
const input = new FileCache(typescript, options); | ||
const compiler: ICompiler = options.isolatedModules ? new FileCompiler() : new ProjectCompiler(); | ||
let running = false; | ||
if (useFileCompiler && !options.isolatedModules) { | ||
throw Error("useFileCompiler: true can only be used if config.compilerOptions.isolatedModules is also set to true"); | ||
} | ||
let compiler: ICompiler; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be indented with tabs |
||
|
||
if (options.isolatedModules) { | ||
if (options.isolatedModules && (useFileCompiler === undefined || useFileCompiler === true)) { | ||
compiler = new FileCompiler(); | ||
options.newLine = typescript.NewLineKind.LineFeed; | ||
options.sourceMap = false; | ||
options.declaration = false; | ||
options.inlineSourceMap = true; | ||
} | ||
} | ||
else { | ||
compiler = new ProjectCompiler(); | ||
} | ||
let running = false; | ||
|
||
const project: PartialProject = (reporter) => { | ||
if (running) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
TypeScript error: [31mtest/useFileCompiler/excluded-dir/test.ts(1,1): [39merror TS2304: Cannot find name 'notCompiled'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please ignore these tests, they are a little borked right now |
||
TypeScript error: [31mtest/useFileCompiler/excluded-file.ts(1,1): [39merror TS2304: Cannot find name 'notCompiled'. | ||
{ | ||
"transpileErrors": 0, | ||
"optionsErrors": 0, | ||
"syntaxErrors": 0, | ||
"globalErrors": 0, | ||
"semanticErrors": 2, | ||
"declarationErrors": 0, | ||
"emitErrors": 0, | ||
"emitSkipped": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normal arguments instead of an object, as you are giving all properties at both calls. So an object does not really add a value here.