Skip to content

Commit

Permalink
fix: fix ssrModuleRunner: false
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 29, 2024
1 parent 593358c commit f634a65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions viteroll/viteroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,11 @@ export class RolldownEnvironment extends DevEnvironment {
if (this.outputOptions.format === "app") {
return this.getRunner().import(input);
}
const output = this.result.output.find((o) => o.name === input);
assert(output, `invalid import input '${input}'`);
// input is no use
const output = this.result.output[0];
const filepath = path.join(this.outDir, output.fileName);
// TODO: source map not applied when adding `?t=...`?
// return import(`${pathToFileURL(filepath)}`)
return import(`${pathToFileURL(filepath)}?t=${this.buildTimestamp}`);
}
}
Expand Down

0 comments on commit f634a65

Please sign in to comment.