Skip to content

Commit 2f01ad3

Browse files
ts -> "typescript"
1 parent 405f434 commit 2f01ad3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Jakefile

+4-6
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,11 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright
314314
}));
315315
prependFile(copyright, standaloneDefinitionsFile);
316316

317-
// Create the node definition file by appending "export = ts;"
317+
// Create the node definition file by replacing 'ts' module with '"typescript"' as a module.
318318
jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true});
319-
fs.appendFileSync(nodeDefinitionsFile,
320-
os.EOL +
321-
'declare module "typescript" {' + os.EOL +
322-
' export = ts;' + os.EOL +
323-
'}');
319+
var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString();
320+
definitionFileContents = definitionFileContents.replace(/declare module ts/g, 'declare module "typescript"');
321+
fs.writeFileSync(nodeDefinitionsFile, definitionFileContents);
324322

325323
// Delete the temp dir
326324
jake.rmRf(tempDirPath, {silent: true});

0 commit comments

Comments
 (0)