Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 3853595

Browse files
committed
fix: exports field
1 parent 9c914de commit 3853595

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

index.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
import './shims'
2-
import './ref-macros'
3-
export * from './dist/index'
42
export { default } from './dist/index'

package.json

+8-22
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,15 @@
1515
"license": "MIT",
1616
"author": "Anthony Fu <[email protected]>",
1717
"exports": {
18-
".": {
19-
"require": "./dist/index.js"
20-
},
18+
".": "./dist/index.js",
2119
"./*": "./*",
22-
"./jest": {
23-
"require": "./jest.js"
24-
},
25-
"./nuxt": {
26-
"require": "./dist/nuxt.js"
27-
},
28-
"./rollup": {
29-
"require": "./dist/rollup.js"
30-
},
31-
"./types": {
32-
"require": "./dist/types.js"
33-
},
34-
"./vite": {
35-
"require": "./dist/vite.js"
36-
},
37-
"./webpack": {
38-
"require": "./dist/webpack.js"
39-
}
40-
},
20+
"./jest":"./jest.js",
21+
"./nuxt": "./dist/nuxt.js",
22+
"./rollup": "./dist/rollup.js",
23+
"./types": "./dist/types.js",
24+
"./vite":"./dist/vite.js",
25+
"./webpack": "./dist/webpack.js"
26+
},
4127
"main": "dist/index.js",
4228
"types": "index.d.ts",
4329
"files": [

scripts/postbuild.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import fg from 'fast-glob'
66
async function run() {
77
// fix cjs exports
88
const files = await fg('*.js', {
9-
ignore: ['index.js', 'chunk-*'],
9+
ignore: ['chunk-*'],
1010
absolute: true,
1111
cwd: resolve(__dirname, '../dist'),
1212
})

src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { transform } from './core'
55

66
export * from './core'
77

8-
export default createUnplugin<PluginOptions>((options = {}) => {
8+
export const unplugin = createUnplugin<PluginOptions>((options = {}) => {
99
const filter = createFilter(
1010
options.include || (options.refTransform ? [/\.vue$/, /\.vue\?vue/, /\.[jt]sx?$/] : [/\.vue$/, /\.vue\?vue/]),
1111
options.exclude || [/node_modules/, /\.git/, /\.nuxt/],
@@ -27,3 +27,5 @@ export default createUnplugin<PluginOptions>((options = {}) => {
2727
},
2828
}
2929
})
30+
31+
export default unplugin

0 commit comments

Comments
 (0)