diff --git a/snowpack/src/commands/build.ts b/snowpack/src/commands/build.ts index e1acc9b112..a832b65c11 100644 --- a/snowpack/src/commands/build.ts +++ b/snowpack/src/commands/build.ts @@ -145,7 +145,9 @@ class FileBuilder { this.filesToResolve = {}; const isSSR = this.config.experiments.ssr; const srcExt = path.extname(url.fileURLToPath(this.fileURL)); - const fileOutput = this.mountEntry.static + // Workaround: HMR plugins need to add scripts to HTML file, even if static. + // TODO: Remove once no longer needed in dev. + const fileOutput = (this.mountEntry.static && srcExt !== '.html') ? {[srcExt]: {code: await readFile(this.fileURL)}} : await buildFile(this.fileURL, { plugins: this.config.plugins, diff --git a/snowpack/src/commands/dev.ts b/snowpack/src/commands/dev.ts index 440cca03cb..24bc9842e5 100644 --- a/snowpack/src/commands/dev.ts +++ b/snowpack/src/commands/dev.ts @@ -877,7 +877,10 @@ export async function startDevServer(commandOptions: CommandOptions): Promise