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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugin/index.mjs +4 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-vanjs",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "author": "thednp",
5
5
  "license": "MIT",
6
6
  "description": "A mini meta-framework for VanJS powered by Vite",
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
- context = this;
79
- viteVersion = context.meta?.viteVersion[0];
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
- ? `console.log(\`🍦 @vanjs/router registered ${currentRoutes.length} routes.\`)`
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