@vtj/local 0.8.130 → 0.8.132
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 +0 -1
- package/dist/plugin.mjs +5 -9
- package/dist/shared.d.ts +1 -0
- package/dist/shared.mjs +1 -0
- package/package.json +5 -5
package/dist/plugin.d.ts
CHANGED
package/dist/plugin.mjs
CHANGED
@@ -6,6 +6,7 @@ import { pathExistsSync, readJsonSync } from "@vtj/node";
|
|
6
6
|
import { join, resolve } from "path";
|
7
7
|
import bodyParser from "body-parser";
|
8
8
|
import { router } from "./controller.mjs";
|
9
|
+
import { CLIENT_DIR } from "./shared.mjs";
|
9
10
|
const setApis = (server, options) => {
|
10
11
|
server.middlewares.use(
|
11
12
|
bodyParser.json({ type: "application/json", limit: "50000kb" })
|
@@ -36,11 +37,7 @@ const apiServerPlugin = function(options) {
|
|
36
37
|
};
|
37
38
|
};
|
38
39
|
const linkPlugin = function(options) {
|
39
|
-
const {
|
40
|
-
entry = "/index.html",
|
41
|
-
href = "",
|
42
|
-
serveOnly = true
|
43
|
-
} = options.linkOptions || {};
|
40
|
+
const { entry = "/index.html", serveOnly = true } = options.linkOptions || {};
|
44
41
|
let config;
|
45
42
|
return {
|
46
43
|
name: "vtj-link-plugin",
|
@@ -56,12 +53,11 @@ const linkPlugin = function(options) {
|
|
56
53
|
if (ctx.path !== entry) {
|
57
54
|
return html;
|
58
55
|
}
|
59
|
-
const link = typeof options.link === "string" ? options.link : `${
|
56
|
+
const link = typeof options.link === "string" ? options.link : `${CLIENT_DIR}/entry/index.js`;
|
60
57
|
const url = `${config.base}${link}`;
|
61
58
|
return html.replace(
|
62
59
|
/<\/body>/,
|
63
60
|
`
|
64
|
-
<script>window.__VTJ_LINK__ = { href: '${href}' }<\/script>
|
65
61
|
<script src="${url}"><\/script></body>
|
66
62
|
`
|
67
63
|
);
|
@@ -173,7 +169,7 @@ export function parsePresetPlugins(options) {
|
|
173
169
|
}
|
174
170
|
export function createDevTools(options = {}) {
|
175
171
|
const opts = {
|
176
|
-
baseURL:
|
172
|
+
baseURL: `/${CLIENT_DIR}/api`,
|
177
173
|
copy: true,
|
178
174
|
server: true,
|
179
175
|
staticBase: "/",
|
@@ -242,7 +238,7 @@ export function createDevTools(options = {}) {
|
|
242
238
|
const staticOptions = [];
|
243
239
|
if (pathExistsSync(proPath)) {
|
244
240
|
staticOptions.push({
|
245
|
-
path: `${opts.staticBase}${
|
241
|
+
path: `${opts.staticBase}${CLIENT_DIR}`,
|
246
242
|
dir: proPath
|
247
243
|
});
|
248
244
|
}
|
package/dist/shared.d.ts
CHANGED
package/dist/shared.mjs
CHANGED
package/package.json
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vtj/local",
|
3
3
|
"private": false,
|
4
|
-
"version": "0.8.
|
4
|
+
"version": "0.8.132",
|
5
5
|
"type": "module",
|
6
6
|
"dependencies": {
|
7
7
|
"formidable": "~3.5.1",
|
8
|
-
"@vtj/coder": "~0.8.
|
9
|
-
"@vtj/
|
10
|
-
"@vtj/
|
8
|
+
"@vtj/coder": "~0.8.132",
|
9
|
+
"@vtj/node": "~0.8.11",
|
10
|
+
"@vtj/core": "~0.8.132"
|
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
16
|
"vitest": "~2.0.3",
|
17
|
-
"@vtj/cli": "~0.8.
|
17
|
+
"@vtj/cli": "~0.8.29"
|
18
18
|
},
|
19
19
|
"exports": {
|
20
20
|
".": {
|