vite-plugin-vanjs 0.1.3 → 0.1.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/package.json +1 -1
- package/plugin/index.mjs +0 -19
- package/server/index.mjs +6 -2
package/package.json
CHANGED
package/plugin/index.mjs
CHANGED
|
@@ -19,22 +19,14 @@ const pluginDefaults = {
|
|
|
19
19
|
extensions: [".tsx", ".jsx", ".ts", ".js"],
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
// Aliases coming from plugin.config()
|
|
23
|
-
// const resolvedVan = toAbsolute("../setup/van");
|
|
24
|
-
// const resolvedVanX = toAbsolute("../setup/vanX");
|
|
25
|
-
// const resolvedSetup = toAbsolute("../setup/index");
|
|
26
|
-
|
|
27
22
|
// Define module mapping configuration
|
|
28
23
|
const moduleAliases = {
|
|
29
24
|
// Core modules
|
|
30
25
|
"@vanjs/van": "../setup/van",
|
|
31
|
-
// [resolvedVan]: "../setup/van",
|
|
32
26
|
"@vanjs/vanX": "../setup/vanX",
|
|
33
|
-
// [resolvedVanX]: "../setup/vanX",
|
|
34
27
|
|
|
35
28
|
// Setup modules
|
|
36
29
|
"@vanjs/setup": "../setup/index",
|
|
37
|
-
// [resolvedSetup]: "../setup/index",
|
|
38
30
|
|
|
39
31
|
// Other modules
|
|
40
32
|
"@vanjs/client": "../client",
|
|
@@ -47,19 +39,14 @@ const moduleAliases = {
|
|
|
47
39
|
// SSR specific module mappings
|
|
48
40
|
const ssrModuleAliases = {
|
|
49
41
|
"@vanjs/van": "../setup/van-ssr",
|
|
50
|
-
// [resolvedVan]: "../setup/van-ssr",
|
|
51
42
|
"@vanjs/vanX": "../setup/vanX-ssr",
|
|
52
|
-
// [resolvedVanX]: "../setup/vanX-ssr",
|
|
53
43
|
"@vanjs/setup": "../setup/index-ssr",
|
|
54
|
-
// [resolvedSetup]: "../setup/index-ssr",
|
|
55
44
|
};
|
|
56
45
|
|
|
57
46
|
// Debug specific module mappings (development only)
|
|
58
47
|
const debugModuleAliases = {
|
|
59
48
|
"@vanjs/van": "../setup/van-debug",
|
|
60
|
-
// [resolvedVan]: "../setup/van-debug",
|
|
61
49
|
"@vanjs/setup": "../setup/index-debug",
|
|
62
|
-
// [resolvedSetup]: "../setup/index-debug",
|
|
63
50
|
};
|
|
64
51
|
|
|
65
52
|
export default function VitePluginVanJS(options = {}) {
|
|
@@ -155,14 +142,8 @@ export default function VitePluginVanJS(options = {}) {
|
|
|
155
142
|
const isTest = process.env.NODE_ENV === "test";
|
|
156
143
|
const isSetupFile = typeof importer === "string" &&
|
|
157
144
|
importer.includes("vite-plugin-vanjs/setup");
|
|
158
|
-
// const isVanXFile = typeof importer === "string" &&
|
|
159
|
-
// importer.includes("vanjs-ext/src/van-x");
|
|
160
145
|
const isImportedVanXFile = typeof importer === "string" &&
|
|
161
146
|
importer.includes("vite-plugin-vanjs/setup/vanX");
|
|
162
|
-
// const isImportedVanFile = !isImportedVanXFile && typeof importer === "string" &&
|
|
163
|
-
// importer.includes("vite-plugin-vanjs/setup/van");
|
|
164
|
-
// const isImportedSetupFile = typeof importer === "string" &&
|
|
165
|
-
// importer.includes("vite-plugin-vanjs/setup/index");
|
|
166
147
|
const isResolvedVanXFile = source.includes(
|
|
167
148
|
"vite-plugin-vanjs/setup/vanX",
|
|
168
149
|
);
|
package/server/index.mjs
CHANGED
|
@@ -80,8 +80,12 @@ export function renderPreloadLinks(modules, manifest) {
|
|
|
80
80
|
|
|
81
81
|
// First pass: collect all assets from ignored paths
|
|
82
82
|
Object.entries(manifest).forEach(([id, files]) => {
|
|
83
|
-
// istanbul ignore else
|
|
84
|
-
if (
|
|
83
|
+
// istanbul ignore else - don't pre-render routes, layouts and JSX stuff
|
|
84
|
+
if (
|
|
85
|
+
["src/pages", "src/routes", "vite-plugin-vanjs/jsx"].some((l) =>
|
|
86
|
+
id.includes(l)
|
|
87
|
+
)
|
|
88
|
+
) {
|
|
85
89
|
files.forEach((asset) => ignoredAssets.add(asset));
|
|
86
90
|
}
|
|
87
91
|
});
|