vite-plugin-vanjs 0.1.1 → 0.1.2

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 +12 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-vanjs",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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
@@ -133,13 +133,22 @@ export default function VitePluginVanJS(options = {}) {
133
133
  );
134
134
 
135
135
  // Resolve early when source already resolved. EG: @vanjs/van
136
- if (source === setupResolved || setupResolved.includes(source)) {
136
+ if (
137
+ (ops.ssr || isTest) &&
138
+ (source === setupResolved || setupResolved.includes(source))
139
+ ) {
137
140
  return setupResolved;
138
141
  }
139
- if (source === resolvedVan || resolvedVan.includes(source)) {
142
+ if (
143
+ (ops.ssr || isTest) &&
144
+ (source === resolvedVan || resolvedVan.includes(source))
145
+ ) {
140
146
  return resolvedVan;
141
147
  }
142
- if (source === resolvedVanX || resolvedVanX.includes(source)) {
148
+ if (
149
+ (ops.ssr || isTest) &&
150
+ (source === resolvedVanX || resolvedVanX.includes(source))
151
+ ) {
143
152
  return resolvedVanX;
144
153
  }
145
154