@marko/vite 4.0.3 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +6 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -313,12 +313,16 @@ function esbuildPlugin(compiler, config) {
|
|
|
313
313
|
const virtualFiles2 = /* @__PURE__ */ new Map();
|
|
314
314
|
const finalConfig = {
|
|
315
315
|
...config,
|
|
316
|
-
output:
|
|
316
|
+
output: platform === "browser" ? "dom" : "html",
|
|
317
317
|
resolveVirtualDependency(from, dep) {
|
|
318
318
|
virtualFiles2.set(path2.join(from, "..", dep.virtualPath), dep);
|
|
319
319
|
return dep.virtualPath;
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
+
const scanConfig = {
|
|
323
|
+
...finalConfig,
|
|
324
|
+
output: "hydrate"
|
|
325
|
+
};
|
|
322
326
|
build.onResolve({ filter: /\.marko\./ }, (args) => {
|
|
323
327
|
return {
|
|
324
328
|
namespace: "marko:virtual",
|
|
@@ -337,7 +341,7 @@ function esbuildPlugin(compiler, config) {
|
|
|
337
341
|
try {
|
|
338
342
|
const { code, meta } = await compiler.compileFile(
|
|
339
343
|
args.path,
|
|
340
|
-
finalConfig
|
|
344
|
+
isScan && args.namespace === "" ? scanConfig : finalConfig
|
|
341
345
|
);
|
|
342
346
|
return {
|
|
343
347
|
loader: "js",
|