-
-
Notifications
You must be signed in to change notification settings - Fork 42
Should avoid generating inline sourcemaps for unchanged *.js files #108
Copy link
Copy link
Closed
Description
When ember-template-imports gets added all .js files end up including new inline sourcemaps.
Quick summary:
- ember-template-imports adds a custom preprocessor for
.jsfiles here - that preprocessor (from here) calls
preprocessEmbeddedTemplates - that uses
magic-stringto process specific template-literals - it uses magic-string for all .js files, it ends up including sourcemaps for every .js file regardless if there were any templates in it
Tldr; we should change
to something like:
const hasChanges = template !== output;
if (includeSourceMaps && hasChanges) {
const { dir, name } = path.parse(relativePath);
const map = s.generateMap({
file: `${dir}/${name}.js`,
source: relativePath,
includeContent: true,
hires: true,
});
output += `\n//# sourceMappingURL=${map.toUrl()}`;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels