Skip to content
Closed
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
14 changes: 12 additions & 2 deletions lib/broccoli/broccoli-typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ class BroccoliTypeScriptCompiler extends Plugin {
this._fileRegistry[tsFilePath].outputs.forEach(absoluteFilePath => {
const outputFilePath = absoluteFilePath.replace(this.cachePath, this.outputPath);
fse.mkdirsSync(path.dirname(outputFilePath));
fs.symlinkSync(absoluteFilePath, outputFilePath);
try {
fs.symlinkSync(absoluteFilePath, outputFilePath);
} catch (e) {
const conentStr = fs.readFileSync(absoluteFilePath);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be contentStr?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, will fix it in another PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #981

fs.writeFileSync(outputFilePath, conentStr);
}
});
} else {
this._fileRegistry[tsFilePath].version = entry.mtime;
Expand Down Expand Up @@ -203,7 +208,12 @@ class BroccoliTypeScriptCompiler extends Plugin {
fs.writeFileSync(absoluteFilePath, content, FS_OPTS);

fse.mkdirsSync(path.dirname(outputFilePath));
fs.symlinkSync(absoluteFilePath, outputFilePath);
try {
fs.symlinkSync(absoluteFilePath, outputFilePath);
} catch (e) {
const conentStr = fs.readFileSync(absoluteFilePath);
fs.writeFileSync(outputFilePath, conentStr);
}
}

_addNewFileEntry(entry, checkDuplicates /* = true */) {
Expand Down