Skip to content

Commit b0fa719

Browse files
author
Daniel Gröger
committed
Fix relative component paths for sourcemaps
1 parent 9aa461b commit b0fa719

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/colocated-broccoli-plugin.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,22 @@ module.exports = class ColocatedTemplateProcessor extends Plugin {
102102
let hasBackingClass = false;
103103
let hasTemplate = this.inputHasFile(basePath + '.hbs');
104104
let backingClassPath = basePath;
105-
105+
let ext;
106106
if (this.inputHasFile(basePath + '.js')) {
107107
backingClassPath += '.js';
108+
ext = '.js';
108109
hasBackingClass = true;
109110
} else if (this.inputHasFile(basePath + '.ts')) {
110111
backingClassPath += '.ts';
112+
ext = '.ts';
111113
hasBackingClass = true;
112114
} else if (this.inputHasFile(basePath + '.coffee')) {
113115
backingClassPath += '.coffee';
116+
ext = '.coffee';
114117
hasBackingClass = true;
115118
} else {
116119
backingClassPath += '.js';
120+
ext = '.js';
117121
hasBackingClass = false;
118122
}
119123

@@ -173,9 +177,10 @@ module.exports = class ColocatedTemplateProcessor extends Plugin {
173177

174178
// It's not clear to me how to format this correctly for coffeescript.
175179
if (!backingClassPath.endsWith('.coffee')) {
180+
let file = filePathParts.name + ext;
176181
let jsContentsMap = jsContentsMagic.generateMap({
177-
source: jsOutputPath,
178-
file: jsOutputPath,
182+
source: backingClassPath,
183+
file,
179184
includeContent: true,
180185
hires: true
181186
});

0 commit comments

Comments
 (0)