veslx 0.0.14 → 0.0.15

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 +3 -1
  2. package/vite.config.ts +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veslx",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "veslx": "bin/veslx.ts"
@@ -14,6 +14,8 @@
14
14
  "start": "vite preview"
15
15
  },
16
16
  "dependencies": {
17
+ "acorn": "^8.15.0",
18
+ "acorn-jsx": "^5.3.2",
17
19
  "@icons-pack/react-simple-icons": "^13.8.0",
18
20
  "@mdx-js/react": "^3.1.1",
19
21
  "@radix-ui/react-collapsible": "^1.1.12",
package/vite.config.ts CHANGED
@@ -10,8 +10,13 @@ import remarkGfm from 'remark-gfm'
10
10
  import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
11
11
  import { fileURLToPath } from 'url'
12
12
  import path from 'path'
13
+ import { createRequire } from 'module'
13
14
 
14
15
  const __dirname = path.dirname(fileURLToPath(import.meta.url))
16
+ const require = createRequire(import.meta.url)
17
+
18
+ // Resolve these packages from veslx's own node_modules to avoid CommonJS/ESM interop issues
19
+ const resolveFromVeslx = (pkg: string) => path.dirname(require.resolve(`${pkg}/package.json`))
15
20
 
16
21
  export default defineConfig({
17
22
  clearScreen: false,
@@ -38,6 +43,15 @@ export default defineConfig({
38
43
  resolve: {
39
44
  alias: {
40
45
  '@': path.join(__dirname, 'src'),
46
+ // Force these CommonJS packages to resolve from veslx's node_modules
47
+ // to ensure consistent ESM interop when running from installed package
48
+ 'acorn-jsx': resolveFromVeslx('acorn-jsx'),
49
+ 'acorn': resolveFromVeslx('acorn'),
50
+ 'recma-jsx': resolveFromVeslx('recma-jsx'),
51
+ 'recma-parse': resolveFromVeslx('recma-parse'),
52
+ 'recma-stringify': resolveFromVeslx('recma-stringify'),
53
+ 'micromark-extension-mdxjs': resolveFromVeslx('micromark-extension-mdxjs'),
54
+ 'estree-util-to-js': resolveFromVeslx('estree-util-to-js'),
41
55
  },
42
56
  },
43
57
  server: {
@@ -74,6 +88,7 @@ export default defineConfig({
74
88
  'micromark-extension-mdxjs',
75
89
  'style-to-js',
76
90
  'style-to-object',
91
+ 'debug',
77
92
  ],
78
93
  },
79
94
  })