@@ -17222,13 +17222,13 @@ function normalize(fileName) {
17222
17222
}
17223
17223
17224
17224
class LanguageServiceHost {
17225
- constructor(parsedConfig, transformers) {
17225
+ constructor(parsedConfig, transformers, cwd ) {
17226
17226
this.parsedConfig = parsedConfig;
17227
17227
this.transformers = transformers;
17228
- this.cwd = process.cwd();
17229
17228
this.snapshots = {};
17230
17229
this.versions = {};
17231
17230
this.fileNames = new Set(parsedConfig.fileNames);
17231
+ this.cwd = cwd;
17232
17232
}
17233
17233
reset() {
17234
17234
this.snapshots = {};
@@ -24964,7 +24964,7 @@ function printDiagnostics(context, diagnostics, pretty) {
24964
24964
24965
24965
// tslint:disable-next-line:no-var-requires
24966
24966
const createRollupFilter = require("rollup-pluginutils").createFilter;
24967
- function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsedTsconfig) {
24967
+ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot, cwd }, preParsedTsconfig) {
24968
24968
const overrides = {
24969
24969
noEmitHelpers: false,
24970
24970
importHelpers: true,
@@ -24982,7 +24982,7 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
24982
24982
if (!declaration)
24983
24983
overrides.declarationDir = undefined;
24984
24984
if (declaration && !useTsconfigDeclarationDir)
24985
- overrides.declarationDir = process. cwd() ;
24985
+ overrides.declarationDir = cwd;
24986
24986
// unsetting sourceRoot if sourceMap is not enabled (in case original tsconfig had inlineSourceMap set that is being unset and would cause TS5051)
24987
24987
const sourceMap = preParsedTsconfig.options.sourceMap;
24988
24988
if (!sourceMap)
@@ -25024,12 +25024,12 @@ function checkTsConfig(parsedConfig) {
25024
25024
}
25025
25025
25026
25026
function parseTsConfig(context, pluginOptions) {
25027
- const fileName = tsModule.findConfigFile(process .cwd() , tsModule.sys.fileExists, pluginOptions.tsconfig);
25027
+ const fileName = tsModule.findConfigFile(pluginOptions .cwd, tsModule.sys.fileExists, pluginOptions.tsconfig);
25028
25028
// if the value was provided, but no file, fail hard
25029
25029
if (pluginOptions.tsconfig !== undefined && !fileName)
25030
25030
throw new Error(`failed to open '${fileName}'`);
25031
25031
let loadedConfig = {};
25032
- let baseDir = process .cwd() ;
25032
+ let baseDir = pluginOptions .cwd;
25033
25033
let configFileName;
25034
25034
let pretty = false;
25035
25035
if (fileName) {
@@ -27263,6 +27263,7 @@ const typescript = (options) => {
27263
27263
transformers: [],
27264
27264
tsconfigDefaults: {},
27265
27265
objectHashIgnoreUnknownHack: false,
27266
+ cwd: process.cwd(),
27266
27267
});
27267
27268
if (!pluginOptions.typescript) {
27268
27269
pluginOptions.typescript = require("typescript");
@@ -27291,7 +27292,7 @@ const typescript = (options) => {
27291
27292
context.info(`running in watch mode`);
27292
27293
}
27293
27294
filter = createFilter(context, pluginOptions, parsedConfig);
27294
- servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers);
27295
+ servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers, pluginOptions.cwd );
27295
27296
service = tsModule.createLanguageService(servicesHost, tsModule.createDocumentRegistry());
27296
27297
servicesHost.setLanguageService(service);
27297
27298
// printing compiler option errors
@@ -27455,7 +27456,7 @@ const typescript = (options) => {
27455
27456
tsModule.sys.writeFile(fileName, entry.text, entry.writeByteOrderMark);
27456
27457
}
27457
27458
else {
27458
- const relativePath = path.relative(process .cwd() , fileName);
27459
+ const relativePath = path.relative(pluginOptions .cwd, fileName);
27459
27460
context.debug(() => `${safe_5("emitting declarations")} for '${key}' to '${relativePath}'`);
27460
27461
this.emitFile({
27461
27462
type: "asset",
0 commit comments