Skip to content

Commit 68188bd

Browse files
committed
Merge pull request #739 from david-driscoll/babel-fix
Change babel directory when transforming
2 parents 80aee44 + b1d5153 commit 68188bd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dist/main/lang/modules/building.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ function runExternalTranspiler(sourceFileName, sourceFileText, outputFile, proje
161161
if (!settings.compilerOptions.removeComments) {
162162
babelOptions.comments = true;
163163
}
164+
var directory = process.cwd();
165+
process.chdir(project.projectFile.projectFileDirectory);
164166
var babelResult = babel.transform(outputFile.text, babelOptions);
167+
process.chdir(directory);
165168
outputFile.text = babelResult.code;
166169
if (babelResult.map && settings.compilerOptions.sourceMap) {
167170
var additionalEmit = {

lib/main/lang/modules/building.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ function runExternalTranspiler(sourceFileName: string,
203203
babelOptions.comments = true;
204204
}
205205

206+
var directory = process.cwd();
207+
process.chdir(project.projectFile.projectFileDirectory);
206208
let babelResult = babel.transform(outputFile.text, babelOptions);
209+
process.chdir(directory);
207210
outputFile.text = babelResult.code;
208211

209212
if (babelResult.map && settings.compilerOptions.sourceMap) {

0 commit comments

Comments
 (0)