Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
arggh committed Jul 19, 2021
1 parent d14f623 commit 53f0039
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MelteCompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ SvelteCompiler = class SvelteCompiler extends CachingCompiler {
// The compile result returned from `compileOneFile` can be an array or an
// object. If the processed HTML file is not a Svelte component, the result is
// an array of HTML sections (head and/or body). Otherwise, it's an object
// with JavaScript from a compiled Svelte cmponent.
// with JavaScript from a compiled Svelte component.
compileResultSize(result) {
let size = 0;

if (Array.isArray(result)) {
result.forEach(section => size += section.data.length);
} else {
const { js, css } = result;

if (js && js.data) {
size += js.data.length + js.sourceMap.toString().length;
}
Expand Down Expand Up @@ -208,7 +208,7 @@ SvelteCompiler = class SvelteCompiler extends CachingCompiler {
if (css) {
file.addStylesheet(css);
}

return js;
});
}
Expand All @@ -217,7 +217,7 @@ SvelteCompiler = class SvelteCompiler extends CachingCompiler {
async compileOneFile(file) {
// Search for head and body tags if lazy compilation isn't supported.
// Otherwise, the file has already been parsed in `compileOneFileLater`.

if (!file.supportsLazyCompilation) {
const sections = this.getHtmlSections(file);

Expand Down

0 comments on commit 53f0039

Please sign in to comment.