Skip to content

Commit 5ff0d6a

Browse files
authored
chore: drop CJS build (#151)
Co-authored-by: Alec Larson <[email protected]> BREAKING CHANGE
1 parent 03ffe4a commit 5ff0d6a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Give [`vite`] the ability to resolve imports using TypeScript's path mapping.
1919

2020
1. Install as dev dependency
2121

22-
2. Inject `vite-tsconfig-paths` using the `vite.config.ts` module
22+
2. Ensure the project either has `"type": "module"` set or that the Vite config is renamed to `vite.config.mjs` / `vite.config.mts` depending on whether TypeScript is used
23+
24+
3. Inject `vite-tsconfig-paths` in the Vite config
2325

2426
```ts
2527
import { defineConfig } from 'vite'

package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
"name": "vite-tsconfig-paths",
33
"version": "4.3.2",
44
"description": "Vite resolver for TypeScript compilerOptions.paths",
5-
"main": "dist/index.js",
6-
"module": "dist/index.mjs",
5+
"type": "module",
76
"exports": {
8-
"import": "./dist/index.mjs",
9-
"require": {
10-
"types": "./dist/index.d.ts",
11-
"default": "./dist/index.js"
12-
}
7+
"types": "./dist/index.d.ts",
8+
"default": "./dist/index.js"
139
},
1410
"author": "aleclarson",
1511
"repository": "aleclarson/vite-tsconfig-paths",
@@ -18,7 +14,7 @@
1814
"clean": "rimraf dist && git checkout HEAD dist",
1915
"dev": "yarn bundle --watch",
2016
"build": "yarn clean && yarn bundle",
21-
"bundle": "tsup-node src/index.ts --sourcemap --dts --format cjs,esm",
17+
"bundle": "tsup-node src/index.ts --sourcemap --dts --format esm",
2218
"prepare": "yarn build",
2319
"test": "jest"
2420
},

0 commit comments

Comments
 (0)