File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
import babel from '@rollup/plugin-babel' ;
2
2
import commonjs from '@rollup/plugin-commonjs' ;
3
3
import resolve from '@rollup/plugin-node-resolve' ;
4
+ import dts from 'rollup-plugin-dts' ;
4
5
import { terser } from 'rollup-plugin-terser' ;
5
6
import typescript2 from 'rollup-plugin-typescript2' ;
6
7
8
+ import pkg from '../package.json' ;
9
+
7
10
/**
8
11
* @type { import('rollup').RollupOptions }
9
12
*/
10
13
const RollUpConfig = {
11
14
input : 'src/index.ts' ,
12
15
output : [
13
16
{
14
- file : './dist/index.es.js' ,
17
+ file : pkg . module ,
15
18
format : 'esm' ,
16
19
} ,
17
20
{
18
21
name : 'VueRequest' ,
19
- file : './dist/index.cjs.js' ,
22
+ file : pkg . main ,
20
23
format : 'commonjs' ,
21
24
exports : 'named' ,
22
25
} ,
23
26
{
24
27
name : 'VueRequest' ,
25
- file : './dist/vue-request.min.js' ,
28
+ file : pkg . unpkg ,
26
29
format : 'umd' ,
27
30
exports : 'named' ,
28
31
extend : true ,
@@ -50,4 +53,11 @@ const RollUpConfig = {
50
53
] ,
51
54
external : [ 'vue' , 'vue-demi' ] ,
52
55
} ;
53
- export default RollUpConfig ;
56
+
57
+ const dtsConfig = {
58
+ input : RollUpConfig . input ,
59
+ output : [ { file : pkg . types , format : 'es' } ] ,
60
+ plugins : [ dts ( ) ] ,
61
+ } ;
62
+
63
+ export default [ RollUpConfig , dtsConfig ] ;
Original file line number Diff line number Diff line change 102
102
"prettier" : " ^2.2.0" ,
103
103
"rimraf" : " ^3.0.2" ,
104
104
"rollup" : " ^2.33.1" ,
105
+ "rollup-plugin-dts" : " ^4.2.0" ,
105
106
"rollup-plugin-terser" : " ^7.0.2" ,
106
107
"rollup-plugin-typescript2" : " ^0.29.0" ,
107
108
"simple-git" : " ^2.21.0" ,
You can’t perform that action at this time.
0 commit comments