@vtj/local 0.8.135 → 0.8.136

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/plugin.d.ts CHANGED
@@ -22,6 +22,7 @@ export interface DevToolsOptions {
22
22
  }
23
23
  export interface LinkOptions {
24
24
  entry?: string;
25
+ href?: string;
25
26
  serveOnly?: boolean;
26
27
  }
27
28
  export declare function parsePresetPlugins(options: DevToolsOptions): {
package/dist/plugin.mjs CHANGED
@@ -37,7 +37,11 @@ const apiServerPlugin = function(options) {
37
37
  };
38
38
  };
39
39
  const linkPlugin = function(options) {
40
- const { entry = "/index.html", serveOnly = true } = options.linkOptions || {};
40
+ const {
41
+ entry = "/index.html",
42
+ href = "",
43
+ serveOnly = true
44
+ } = options.linkOptions || {};
41
45
  let config;
42
46
  return {
43
47
  name: "vtj-link-plugin",
@@ -46,7 +50,7 @@ const linkPlugin = function(options) {
46
50
  config = resolvedConfig;
47
51
  },
48
52
  transformIndexHtml(html, ctx) {
49
- if (html.includes("VTJ-LINK")) {
53
+ if (html.includes("__VTJ_LINK__")) {
50
54
  return html;
51
55
  }
52
56
  if (options.link) {
@@ -58,6 +62,7 @@ const linkPlugin = function(options) {
58
62
  return html.replace(
59
63
  /<\/body>/,
60
64
  `
65
+ <script>window.__VTJ_LINK__ = { href: '${href}' }<\/script>
61
66
  <script src="${url}"><\/script></body>
62
67
  `
63
68
  );
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@vtj/local",
3
3
  "private": false,
4
- "version": "0.8.135",
4
+ "version": "0.8.136",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "formidable": "~3.5.1",
8
- "@vtj/coder": "~0.8.135",
9
- "@vtj/core": "~0.8.135",
10
- "@vtj/node": "~0.8.11"
8
+ "@vtj/coder": "~0.8.136",
9
+ "@vtj/core": "~0.8.136",
10
+ "@vtj/node": "~0.8.12"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/formidable": "~3.4.5",
14
14
  "unbuild": "~2.0.0",
15
15
  "vite": "~5.4.0",
16
- "vitest": "~2.0.3",
17
- "@vtj/cli": "~0.8.30"
16
+ "vitest": "~2.1.1",
17
+ "@vtj/cli": "~0.8.31"
18
18
  },
19
19
  "exports": {
20
20
  ".": {