Skip to content

Commit 3ccbd44

Browse files
committed
refactor!: move api to new entry
1 parent d1ead75 commit 3ccbd44

File tree

4 files changed

+7
-23
lines changed

4 files changed

+7
-23
lines changed

package.json

+4-20
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,29 @@
3232
"types": "dist/index.d.ts",
3333
"exports": {
3434
".": {
35-
"types": {
36-
"require": "./dist/index.d.cts",
37-
"import": "./dist/index.d.ts"
38-
},
3935
"require": "./dist/index.cjs",
4036
"import": "./dist/index.js"
4137
},
4238
"./vite": {
43-
"types": {
44-
"require": "./dist/vite.d.cts",
45-
"import": "./dist/vite.d.ts"
46-
},
4739
"require": "./dist/vite.cjs",
4840
"import": "./dist/vite.js"
4941
},
5042
"./webpack": {
51-
"types": {
52-
"require": "./dist/webpack.d.cts",
53-
"import": "./dist/webpack.d.ts"
54-
},
5543
"require": "./dist/webpack.cjs",
5644
"import": "./dist/webpack.js"
5745
},
5846
"./rollup": {
59-
"types": {
60-
"require": "./dist/rollup.d.cts",
61-
"import": "./dist/rollup.d.ts"
62-
},
6347
"require": "./dist/rollup.cjs",
6448
"import": "./dist/rollup.js"
6549
},
6650
"./esbuild": {
67-
"types": {
68-
"require": "./dist/esbuild.d.cts",
69-
"import": "./dist/esbuild.d.ts"
70-
},
7151
"require": "./dist/esbuild.cjs",
7252
"import": "./dist/esbuild.js"
7353
},
54+
"./api": {
55+
"require": "./dist/api.cjs",
56+
"import": "./dist/api.js"
57+
},
7458
"./*": "./*"
7559
},
7660
"typesVersions": {

src/api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './core'

src/core/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function resolveOptions(rawOptions: Options): ResolvedOptions {
141141
}
142142
}
143143

144-
export default createUnplugin<Options | undefined, false>(
144+
export const plugin = createUnplugin<Options | undefined, false>(
145145
(rawOptions = {}, meta) => {
146146
const options = shallowRef(resolveOptions(rawOptions))
147147

src/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export * from './core'
2-
export { default } from './core'
1+
export { plugin as default } from './core'

0 commit comments

Comments
 (0)