Skip to content
Closed
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
8 changes: 4 additions & 4 deletions src/compilerSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ export function getCompilerOptions(
});

// if `module` is not specified and not using ES6 target, default to CJS module output
if ((!compilerOptions.module) && compilerOptions.target !== 2 /* ES6 */) {
compilerOptions.module = 1; /* CommonJS */
} else if (compilerCompatible && semver.lt(compiler.version, '1.7.3-0') && compilerOptions.target === 2 /* ES6 */) {
if ((!compilerOptions.module) && compilerOptions.target !== compiler.ScriptTarget.ES6) {
compilerOptions.module = compiler.ModuleKind.CommonJS;
} else if (compilerCompatible && semver.lt(compiler.version, '1.7.3-0') && compilerOptions.target === compiler.ScriptTarget.ES6) {
// special handling for TS 1.6 and target: es6
compilerOptions.module = 0 /* None */;
compilerOptions.module = compiler.ModuleKind.None;
}

return compilerOptions;
Expand Down
4 changes: 2 additions & 2 deletions src/servicesHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function makeServicesHost(
const { compiler, compilerOptions, files } = instance;

const newLine =
compilerOptions.newLine === 0 /* CarriageReturnLineFeed */ ? constants.CarriageReturnLineFeed :
compilerOptions.newLine === 1 /* LineFeed */ ? constants.LineFeed :
compilerOptions.newLine === compiler.NewLineKind.CarriageReturnLineFeed ? constants.CarriageReturnLineFeed :
compilerOptions.newLine === compiler.NewLineKind.LineFeed ? constants.LineFeed :
constants.EOL;

// make a (sync) resolver that follows webpack's rules
Expand Down