@marko/vite 4.0.0 → 4.0.1

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.
Files changed (2) hide show
  1. package/dist/index.mjs +3 -3
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -11,9 +11,9 @@ import path from "path";
11
11
  // src/render-assets-runtime.ts
12
12
  var renderAssetsRuntimeId = "\0marko-render-assets.mjs";
13
13
  function getRenderAssetsRuntime(opts) {
14
- return `${!opts.basePathVar ? "const base = import.meta.env.BASE_URL;" : `const base = globalThis.${opts.basePathVar};
14
+ return `${opts.basePathVar && opts.isBuild ? `const base = globalThis.${opts.basePathVar};
15
15
  if (typeof base !== "string") throw new Error("${opts.basePathVar} must be defined when using basePathVar.");
16
- if (!base.endsWith("/")) throw new Error("${opts.basePathVar} must end with a '/' when using basePathVar.");`}
16
+ if (!base.endsWith("/")) throw new Error("${opts.basePathVar} must end with a '/' when using basePathVar.");` : "const base = import.meta.env.BASE_URL;"}
17
17
  export function addAssets(g, newEntries) {
18
18
  const entries = g.___viteEntries;
19
19
  if (entries) {
@@ -24,7 +24,7 @@ export function addAssets(g, newEntries) {
24
24
  g.___viteInjectAttrs = g.cspNonce
25
25
  ? \` nonce="\${g.cspNonce.replace(/"/g, "'")}"\`
26
26
  : "";
27
- ${opts.runtimeId ? `$ g.runtimeId = ${JSON.stringify(opts.runtimeId)};` : ""}
27
+ ${opts.runtimeId ? `g.runtimeId = ${JSON.stringify(opts.runtimeId)};` : ""}
28
28
  }
29
29
  }
30
30
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
3
  "description": "A Marko plugin for Vite",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {