File tree 3 files changed +61
-0
lines changed
3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ import rollup from 'rollup' ;
2
+ import fs from 'fs-extra' ;
3
+ import globby from 'globby' ;
4
+
5
+ interface Target extends globby . GlobbyOptions {
6
+ /**
7
+ * Path or glob of what to copy.
8
+ */
9
+ readonly src : string | readonly string [ ] ;
10
+
11
+ /**
12
+ * One or more destinations where to copy.
13
+ */
14
+ readonly dest : string | readonly string [ ] ;
15
+
16
+ /**
17
+ * Change destination file or folder name.
18
+ */
19
+ readonly rename ?: string | Function ;
20
+ }
21
+
22
+ interface CopyOptions extends globby . GlobbyOptions , fs . CopyOptions {
23
+ /**
24
+ * Copy items once. Useful in watch mode.
25
+ * @default false
26
+ */
27
+ readonly copyOnce ?: boolean ;
28
+
29
+ /**
30
+ * Rollup hook the plugin should use.
31
+ * @default 'buildEnd'
32
+ */
33
+ readonly hook ?: string ;
34
+
35
+ /**
36
+ * Array of targets to copy.
37
+ * @default []
38
+ */
39
+ readonly targets ?: readonly Target [ ] ;
40
+
41
+ /**
42
+ * Output copied items to console.
43
+ * @default false
44
+ */
45
+ readonly verbose ?: boolean ;
46
+ }
47
+
48
+ /**
49
+ * Copy files and folders using Rollup
50
+ */
51
+ export default function copy ( options ?: CopyOptions ) : rollup . Plugin ;
Original file line number Diff line number Diff line change 6
6
"repository" : " vladshcherbin/rollup-plugin-copy" ,
7
7
"main" : " dist/index.commonjs.js" ,
8
8
"module" : " dist/index.module.js" ,
9
+ "types" : " index.d.ts" ,
9
10
"scripts" : {
10
11
"clean" : " rimraf coverage dist" ,
11
12
"build" : " rollup -c" ,
15
16
"test" : " jest"
16
17
},
17
18
"dependencies" : {
19
+ "@types/fs-extra" : " ^7.0.0" ,
18
20
"colorette" : " ^1.0.7" ,
19
21
"fs-extra" : " ^7.0.1" ,
20
22
"globby" : " ^9.2.0" ,
37
39
},
38
40
"files" : [
39
41
" dist" ,
42
+ " index.d.ts" ,
40
43
" readme.md"
41
44
],
42
45
"keywords" : [
Original file line number Diff line number Diff line change 828
828
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
829
829
integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==
830
830
831
+ " @types/fs-extra@^7.0.0 " :
832
+ version "7.0.0"
833
+ resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-7.0.0.tgz#9c4ad9e1339e7448a76698829def1f159c1b636c"
834
+ integrity sha512-ndoMMbGyuToTy4qB6Lex/inR98nPiNHacsgMPvy+zqMLgSxbt8VtWpDArpGp69h1fEDQHn1KB+9DWD++wgbwYA==
835
+ dependencies :
836
+ " @types/node" " *"
837
+
831
838
" @types/glob@^7.1.1 " :
832
839
version "7.1.1"
833
840
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575"
You can’t perform that action at this time.
0 commit comments