Skip to content

Commit d66fc0f

Browse files
fix: update options.input in options hook (#197)
* fix: update options.input in options hook * Create strange-tomatoes-buy.md --------- Co-authored-by: Dylan Piercey <[email protected]>
1 parent 13e244e commit d66fc0f

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.changeset/strange-tomatoes-buy.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@marko/vite": patch
3+
---
4+
5+
fix: update options.input in options hook

src/index.ts

+11-7
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
495495
}
496496
},
497497

498-
async buildStart(inputOptions) {
498+
async options(inputOptions) {
499499
if (isBuild && linked && !isSSRBuild) {
500500
try {
501501
serverManifest = await store.read();
@@ -505,12 +505,6 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
505505
entryIds.add(id);
506506
cachedSources.set(id, serverManifest.entrySources[entry]);
507507
}
508-
for (const assetId of serverManifest.ssrAssetIds) {
509-
this.load({
510-
id: normalizePath(path.resolve(root, assetId)),
511-
resolveDependencies: false,
512-
}).catch(noop);
513-
}
514508
} catch (err) {
515509
this.error(
516510
`You must run the "ssr" build before the "browser" build.`,
@@ -522,6 +516,16 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
522516
}
523517
}
524518
},
519+
async buildStart() {
520+
if (isBuild && linked && !isSSRBuild) {
521+
for (const assetId of serverManifest!.ssrAssetIds) {
522+
this.load({
523+
id: normalizePath(path.resolve(root, assetId)),
524+
resolveDependencies: false,
525+
}).catch(noop);
526+
}
527+
}
528+
},
525529
async resolveId(importee, importer, importOpts, ssr = importOpts.ssr) {
526530
if (virtualFiles.has(importee)) {
527531
return importee;

0 commit comments

Comments
 (0)