Skip to content

Commit 7e9bbb2

Browse files
committed
Drop normalize for older svelte versions
1 parent 834fc95 commit 7e9bbb2

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

index.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ function posixify(file) {
77
return file.replace(/[/\\]/g, '/');
88
}
99

10-
function normalize(compiled) {
11-
// svelte.compile signature changed in 1.60 — this avoids
12-
// future deprecation warnings while preserving backwards
13-
// compatibility
14-
const js = compiled.js || { code: compiled.code, map: compiled.map };
15-
16-
const css = compiled.css && typeof compiled.css === 'object'
17-
? compiled.css
18-
: { code: compiled.css, map: compiled.cssMap };
19-
20-
return { js, css, ast: compiled.ast, warnings: compiled.warnings || compiled.stats.warnings || [] };
21-
}
22-
2310
const virtualModules = new Map();
2411
let index = 0;
2512

@@ -58,7 +45,7 @@ module.exports = function(source, map) {
5845
}
5946

6047
const compiled = compile(processed.toString(), compileOptions);
61-
let { js, css, warnings } = normalize(compiled);
48+
let { js, css, warnings } = compiled;
6249

6350
warnings.forEach(
6451
options.onwarn

0 commit comments

Comments
 (0)