Skip to content

Commit 71a4bd8

Browse files
committed
feat!: drop node 18 & cjs build
1 parent f01fae6 commit 71a4bd8

File tree

11 files changed

+42
-66
lines changed

11 files changed

+42
-66
lines changed

.github/workflows/unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
matrix:
3535
os: [ubuntu-latest, windows-latest]
36-
node: [18, 20, 22]
36+
node: [20, 22, 24]
3737
fail-fast: false
3838

3939
steps:

package.json

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,42 +29,15 @@
2929
"module": "./dist/index.js",
3030
"types": "./dist/index.d.ts",
3131
"exports": {
32-
".": {
33-
"require": "./dist/index.cjs",
34-
"import": "./dist/index.js"
35-
},
36-
"./vite": {
37-
"require": "./dist/vite.cjs",
38-
"import": "./dist/vite.js"
39-
},
40-
"./webpack": {
41-
"require": "./dist/webpack.cjs",
42-
"import": "./dist/webpack.js"
43-
},
44-
"./rollup": {
45-
"require": "./dist/rollup.cjs",
46-
"import": "./dist/rollup.js"
47-
},
48-
"./esbuild": {
49-
"require": "./dist/esbuild.cjs",
50-
"import": "./dist/esbuild.js"
51-
},
52-
"./farm": {
53-
"require": "./dist/farm.cjs",
54-
"import": "./dist/farm.js"
55-
},
56-
"./rspack": {
57-
"require": "./dist/rspack.cjs",
58-
"import": "./dist/rspack.js"
59-
},
60-
"./rolldown": {
61-
"require": "./dist/rolldown.cjs",
62-
"import": "./dist/rolldown.js"
63-
},
64-
"./volar": {
65-
"require": "./dist/volar.cjs",
66-
"import": "./dist/volar.js"
67-
},
32+
".": "./dist/index.js",
33+
"./vite": "./dist/vite.js",
34+
"./webpack": "./dist/webpack.js",
35+
"./rollup": "./dist/rollup.js",
36+
"./esbuild": "./dist/esbuild.js",
37+
"./farm": "./dist/farm.js",
38+
"./rspack": "./dist/rspack.js",
39+
"./rolldown": "./dist/rolldown.js",
40+
"./volar": "./dist/volar.js",
6841
"./*": "./*"
6942
},
7043
"typesVersions": {
@@ -117,7 +90,7 @@
11790
"vue-tsc": "^2.2.10"
11891
},
11992
"engines": {
120-
"node": ">=18.12.0"
93+
"node": ">=20.18.0"
12194
},
12295
"prettier": "@sxzz/prettier-config"
12396
}

src/esbuild.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
* @module
55
*/
66

7-
import VueNamedExport from './index'
7+
import { VueNamedExport } from './index'
88

99
/**
1010
* Esbuild plugin
1111
*
1212
* @example
1313
* ```ts
1414
* import { build } from 'esbuild'
15-
* import Starter from 'unplugin-starter/esbuild'
15+
* import VueNamedExport from 'unplugin-vue-named-export/esbuild'
1616
*
17-
* build({ plugins: [Starter()] })
17+
* build({ plugins: [VueNamedExport()] })
1818
```
1919
*/
2020
const esbuild = VueNamedExport.esbuild as typeof VueNamedExport.esbuild
2121
export default esbuild
22+
export { esbuild as 'module.exports' }

src/farm.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
* @module
55
*/
66

7-
import VueNamedExport from './index'
7+
import { VueNamedExport } from './index'
88

99
/**
1010
* Farm plugin
1111
*
1212
* @example
1313
* ```ts
1414
* // farm.config.js
15-
* import Starter from 'unplugin-starter/farm'
15+
* import VueNamedExport from 'unplugin-vue-named-export/farm'
1616
*
1717
* export default {
18-
* plugins: [Starter()],
18+
* plugins: [VueNamedExport()],
1919
* }
2020
* ```
2121
*/
2222
const farm = VueNamedExport.farm as typeof VueNamedExport.farm
2323
export default farm
24+
export { farm as 'module.exports' }

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function getNodeStart(node: t.Node) {
1313
return node.start!
1414
}
1515

16-
const VueNamedExport: UnpluginInstance<Options | undefined, false> =
16+
export const VueNamedExport: UnpluginInstance<Options | undefined, false> =
1717
createUnplugin((rawOptions = {}) => {
1818
const options = resolveOption(rawOptions)
1919
const filter = createFilter(options.include, options.exclude)
@@ -89,4 +89,3 @@ const VueNamedExport: UnpluginInstance<Options | undefined, false> =
8989
},
9090
}
9191
})
92-
export default VueNamedExport

src/rolldown.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
* @module
55
*/
66

7-
import VueNamedExport from './index'
7+
import { VueNamedExport } from './index'
88

99
/**
1010
* Rolldown plugin
1111
*
1212
* @example
1313
* ```ts
1414
* // rolldown.config.js
15-
* import Starter from 'unplugin-starter/rolldown'
15+
* import VueNamedExport from 'unplugin-vue-named-export/rolldown'
1616
*
1717
* export default {
18-
* plugins: [Starter()],
18+
* plugins: [VueNamedExport()],
1919
* }
2020
* ```
2121
*/
2222
const rolldown = VueNamedExport.rolldown as typeof VueNamedExport.rolldown
2323
export default rolldown
24+
export { rolldown as 'module.exports' }

src/rollup.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
* @module
55
*/
66

7-
import VueNamedExport from './index'
7+
import { VueNamedExport } from './index'
88

99
/**
1010
* Rollup plugin
1111
*
1212
* @example
1313
* ```ts
1414
* // rollup.config.js
15-
* import Starter from 'unplugin-starter/rollup'
15+
* import VueNamedExport from 'unplugin-vue-named-export/rollup'
1616
*
1717
* export default {
18-
* plugins: [Starter()],
18+
* plugins: [VueNamedExport()],
1919
* }
2020
* ```
2121
*/
2222
const rollup = VueNamedExport.rollup as typeof VueNamedExport.rollup
2323
export default rollup
24+
export { rollup as 'module.exports' }

src/rspack.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
* @module
55
*/
66

7-
import VueNamedExport from './index'
7+
import { VueNamedExport } from './index'
88

99
/**
1010
* Rspack plugin
1111
*
1212
* @example
1313
* ```js
1414
* // rspack.config.js
15-
* import Starter from 'unplugin-starter/rspack'
15+
* import VueNamedExport from 'unplugin-vue-named-export/rspack'
1616
*
1717
* default export {
18-
* plugins: [Starter()],
18+
* plugins: [VueNamedExport()],
1919
* }
2020
* ```
2121
*/
2222
const rspack = VueNamedExport.rspack as typeof VueNamedExport.rspack
2323
export default rspack
24+
export { rspack as 'module.exports' }

src/vite.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
* @module
55
*/
66

7-
import VueNamedExport from './index'
7+
import { VueNamedExport } from './index'
88

99
/**
1010
* Vite plugin
1111
*
1212
* @example
1313
* ```ts
1414
* // vite.config.ts
15-
* import Starter from 'unplugin-starter/vite'
15+
* import VueNamedExport from 'unplugin-vue-named-export/vite'
1616
*
1717
* export default defineConfig({
18-
* plugins: [Starter()],
18+
* plugins: [VueNamedExport()],
1919
* })
2020
* ```
2121
*/
2222
const vite = VueNamedExport.vite as typeof VueNamedExport.vite
2323
export default vite
24+
export { vite as 'module.exports' }

src/webpack.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
* @module
55
*/
66

7-
import VueNamedExport from './index'
7+
import { VueNamedExport } from './index'
88

99
/**
1010
* Webpack plugin
1111
*
1212
* @example
1313
* ```js
1414
* // webpack.config.js
15-
* import Starter from 'unplugin-starter/webpack'
15+
* import VueNamedExport from 'unplugin-vue-named-export/webpack'
1616
*
1717
* default export {
18-
* plugins: [Starter()],
18+
* plugins: [VueNamedExport()],
1919
* }
2020
* ```
2121
*/
2222
const webpack = VueNamedExport.webpack as typeof VueNamedExport.webpack
2323
export default webpack
24+
export { webpack as 'module.exports' }

tsdown.config.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { defineConfig } from 'tsdown'
22

33
export default defineConfig({
4-
entry: ['./src/*.ts'],
5-
format: ['cjs', 'esm'],
6-
target: 'node18.12',
7-
clean: true,
8-
dts: true,
4+
entry: './src/*.ts',
5+
format: 'esm',
96
})

0 commit comments

Comments
 (0)