@meituan-nocode/vite-plugin-nocode-compiler 0.2.4-beta.2 → 0.2.4-beta.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.cjs +10 -2
- package/dist/index.js +11 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -56,9 +56,17 @@ function componentCompiler(options = {}) {
|
|
|
56
56
|
const vueCompiler = new import_nocode_compiler_core.VueCompiler(options);
|
|
57
57
|
const jsxCompiler = new import_nocode_compiler_core.JSXCompiler(options);
|
|
58
58
|
let server;
|
|
59
|
+
let pkgRegistry;
|
|
59
60
|
return {
|
|
60
61
|
name: "vite-plugin-nocode-compiler",
|
|
61
62
|
enforce: "pre",
|
|
63
|
+
/**
|
|
64
|
+
* 配置解析完成后,初始化 PackageVersionRegistry
|
|
65
|
+
* 使用 Vite 配置的 root 作为项目根目录
|
|
66
|
+
*/
|
|
67
|
+
configResolved(config) {
|
|
68
|
+
pkgRegistry = new import_nocode_compiler_core.PackageVersionRegistry(config.root);
|
|
69
|
+
},
|
|
62
70
|
/**
|
|
63
71
|
* 配置开发服务器,添加 Override 中间件
|
|
64
72
|
*/
|
|
@@ -167,10 +175,10 @@ function componentCompiler(options = {}) {
|
|
|
167
175
|
query
|
|
168
176
|
});
|
|
169
177
|
if (useJSXCompiler) {
|
|
170
|
-
return jsxCompiler.compile(code, filePath) || code;
|
|
178
|
+
return jsxCompiler.compile(code, filePath, pkgRegistry) || code;
|
|
171
179
|
}
|
|
172
180
|
if (useVueCompiler) {
|
|
173
|
-
return vueCompiler.compile(code, filePath) || code;
|
|
181
|
+
return vueCompiler.compile(code, filePath, pkgRegistry) || code;
|
|
174
182
|
}
|
|
175
183
|
return code;
|
|
176
184
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { resolve } from "path";
|
|
3
|
-
import { JSXCompiler, VueCompiler, detectCompileScenario } from "@meituan-nocode/nocode-compiler-core";
|
|
3
|
+
import { JSXCompiler, VueCompiler, detectCompileScenario, PackageVersionRegistry } from "@meituan-nocode/nocode-compiler-core";
|
|
4
4
|
|
|
5
5
|
// src/utils.ts
|
|
6
6
|
function readJsonBody(req) {
|
|
@@ -31,9 +31,17 @@ function componentCompiler(options = {}) {
|
|
|
31
31
|
const vueCompiler = new VueCompiler(options);
|
|
32
32
|
const jsxCompiler = new JSXCompiler(options);
|
|
33
33
|
let server;
|
|
34
|
+
let pkgRegistry;
|
|
34
35
|
return {
|
|
35
36
|
name: "vite-plugin-nocode-compiler",
|
|
36
37
|
enforce: "pre",
|
|
38
|
+
/**
|
|
39
|
+
* 配置解析完成后,初始化 PackageVersionRegistry
|
|
40
|
+
* 使用 Vite 配置的 root 作为项目根目录
|
|
41
|
+
*/
|
|
42
|
+
configResolved(config) {
|
|
43
|
+
pkgRegistry = new PackageVersionRegistry(config.root);
|
|
44
|
+
},
|
|
37
45
|
/**
|
|
38
46
|
* 配置开发服务器,添加 Override 中间件
|
|
39
47
|
*/
|
|
@@ -142,10 +150,10 @@ function componentCompiler(options = {}) {
|
|
|
142
150
|
query
|
|
143
151
|
});
|
|
144
152
|
if (useJSXCompiler) {
|
|
145
|
-
return jsxCompiler.compile(code, filePath) || code;
|
|
153
|
+
return jsxCompiler.compile(code, filePath, pkgRegistry) || code;
|
|
146
154
|
}
|
|
147
155
|
if (useVueCompiler) {
|
|
148
|
-
return vueCompiler.compile(code, filePath) || code;
|
|
156
|
+
return vueCompiler.compile(code, filePath, pkgRegistry) || code;
|
|
149
157
|
}
|
|
150
158
|
return code;
|
|
151
159
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meituan-nocode/vite-plugin-nocode-compiler",
|
|
3
|
-
"version": "0.2.4-beta.
|
|
3
|
+
"version": "0.2.4-beta.4",
|
|
4
4
|
"description": "Vite plugin for nocode compiler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"tsup": "8.5.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@meituan-nocode/nocode-compiler-core": "0.
|
|
26
|
+
"@meituan-nocode/nocode-compiler-core": "0.2.5-beta.1"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"dev": "tsup --watch",
|