veslx 0.1.17 → 0.1.18
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/vite.config.ts +10 -5
package/package.json
CHANGED
package/vite.config.ts
CHANGED
|
@@ -37,12 +37,17 @@ function reactResolverPlugin(): Plugin {
|
|
|
37
37
|
|
|
38
38
|
return {
|
|
39
39
|
name: 'veslx-react-resolver',
|
|
40
|
-
|
|
41
|
-
resolveId(id) {
|
|
42
|
-
if (resolved.has(id))
|
|
43
|
-
|
|
40
|
+
// Only resolve for user content MDX files (outside veslx's own src)
|
|
41
|
+
async resolveId(id, importer, options) {
|
|
42
|
+
if (!resolved.has(id)) return null
|
|
43
|
+
// Only intercept if importer is outside veslx (user content)
|
|
44
|
+
if (!importer || importer.includes('/veslx/') || importer.includes('node_modules')) {
|
|
45
|
+
return null
|
|
44
46
|
}
|
|
45
|
-
|
|
47
|
+
// Let Vite try first, only fallback to our resolution
|
|
48
|
+
const resolution = await this.resolve(id, importer, { ...options, skipSelf: true })
|
|
49
|
+
if (resolution) return null
|
|
50
|
+
return resolved.get(id)
|
|
46
51
|
},
|
|
47
52
|
}
|
|
48
53
|
}
|