vite-plugin-vanjs 0.1.13 → 0.1.14
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 +4 -9
package/package.json
CHANGED
package/plugin/index.mjs
CHANGED
|
@@ -63,9 +63,6 @@ export default function VitePluginVanJS(options = {}) {
|
|
|
63
63
|
let config;
|
|
64
64
|
/** @type {RouteFile[] | null} */
|
|
65
65
|
let routeCache = null;
|
|
66
|
-
/** @type {PluginContext} */
|
|
67
|
-
let context;
|
|
68
|
-
let viteVersion = "8.0.0";
|
|
69
66
|
let isOxc = true;
|
|
70
67
|
|
|
71
68
|
const virtualModuleId = "virtual:@vanjs/routes";
|
|
@@ -75,9 +72,8 @@ export default function VitePluginVanJS(options = {}) {
|
|
|
75
72
|
name: "vanjs",
|
|
76
73
|
enforce: "pre",
|
|
77
74
|
buildStart() {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
isOxc = Number(viteVersion) >= 8;
|
|
75
|
+
const viteVersion = this.meta?.viteVersion;
|
|
76
|
+
isOxc = Number(viteVersion[0]) >= 8;
|
|
81
77
|
},
|
|
82
78
|
// @ts-expect-error - this is temporary esbuild will be
|
|
83
79
|
config() {
|
|
@@ -239,9 +235,8 @@ routes.length = 0;
|
|
|
239
235
|
// Register routes
|
|
240
236
|
${currentRoutes.map(generateRoute).join("\n")}
|
|
241
237
|
${
|
|
242
|
-
(ops && ops.ssr && currentRoutes.length)
|
|
243
|
-
|
|
244
|
-
: /* istanbul ignore next @preserve */ ""
|
|
238
|
+
(ops && ops.ssr && currentRoutes.length) &&
|
|
239
|
+
`console.log(\`🍦 @vanjs/router registered ${currentRoutes.length} routes.\`)`
|
|
245
240
|
}
|
|
246
241
|
`;
|
|
247
242
|
|