@coraltravelcenter/b2c-landing-builder 2.1.0 → 2.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coraltravelcenter/b2c-landing-builder",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "CLI and build toolkit for B2C landing projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,7 +2,6 @@ import {fileURLToPath} from "node:url";
2
2
  import path from "node:path";
3
3
 
4
4
  import {createServer} from "vite";
5
- import monkey from "vite-plugin-monkey";
6
5
 
7
6
  import {loadConfig} from "../config/load-config.mjs";
8
7
  import {resolvePreset} from "../config/resolve-preset.mjs";
@@ -12,10 +11,25 @@ import {loadProjectVuePlugin} from "../lib/loadProjectVuePlugin.mjs";
12
11
  const clientEntry = fileURLToPath(new URL("./client.js", import.meta.url));
13
12
  const builderRoot = fileURLToPath(new URL("../../", import.meta.url));
14
13
  const clientEntryUrl = `/@fs${clientEntry.replaceAll("\\", "/")}`;
14
+ let monkeyPlugin;
15
+
16
+ async function loadMonkeyPlugin() {
17
+ if (monkeyPlugin) return monkeyPlugin;
18
+
19
+ const projectRoot = process.cwd();
20
+ try {
21
+ process.chdir(builderRoot);
22
+ monkeyPlugin = (await import("vite-plugin-monkey")).default;
23
+ return monkeyPlugin;
24
+ } finally {
25
+ process.chdir(projectRoot);
26
+ }
27
+ }
15
28
 
16
29
  export async function createViteConfig(root = process.cwd()) {
17
30
  const config = await loadConfig(root);
18
31
  const preset = resolvePreset(config.site.preset);
32
+ const monkey = await loadMonkeyPlugin();
19
33
  const shouldOpen = process.env.B2C_NO_OPEN !== "1";
20
34
  const vue = config.stack.script === "vue"
21
35
  ? await loadProjectVuePlugin(root)