File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 99 "main" : " dist/cjs/index.js" ,
1010 "types" : " dist/index.d.ts" ,
1111 "module" : " dist/index.js" ,
12+ "exports" : {
13+ "." : {
14+ "types" : " ./dist/index.d.ts" ,
15+ "import" : " ./dist/index.js" ,
16+ "require" : " ./dist/cjs/index.js" ,
17+ "default" : " ./dist/cjs/index.js"
18+ },
19+ "./package.json" : " ./package.json"
20+ },
1221 "files" : [
1322 " dist" ,
1423 " lib"
Original file line number Diff line number Diff line change 1+ /**
2+ * This script is a workaround for a compatibility issue between Vite and its dependency, Rollup.
3+ * Specifically, Vite's typescript definitions reference a module ('rollup/parseAst') that is not
4+ * directly resolvable with the default module resolution strategy used in some configurations.
5+ *
6+ * The script copies the necessary Rollup files to the expected locations and updates import paths
7+ * in 'parseAst.d.ts' to ensure Vite can correctly import these types.
8+ *
9+ * This workaround should be removed once the underlying issue with Vite's dependency resolution
10+ * is resolved. Ideally, this would be when Vite or Rollup releases an update that addresses the
11+ * issue directly, making this script unnecessary.
12+ *
13+ * Keep an eye on Vite and Rollup's release notes for an update on this issue.
14+ * https://github.com/rollup/rollup/issues/5199
15+ * https://github.com/vitest-dev/vitest/issues/4567
16+ */
17+
118import fs from 'node:fs' ;
219import path from 'node:path' ;
320import { fileURLToPath } from 'node:url' ;
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
33 "module" : " CommonJS" ,
4+ "target" : " es2017" ,
45 "outDir" : " ./dist/cjs" ,
56 "sourceMap" : true ,
67 "declarationMap" : true ,
You can’t perform that action at this time.
0 commit comments