File tree 10 files changed +161
-160
lines changed
10 files changed +161
-160
lines changed Original file line number Diff line number Diff line change 43
43
"@babel/plugin-transform-react-jsx" : " 7.23.4" ,
44
44
"@babel/preset-env" : " 7.23.5" ,
45
45
"@babel/preset-typescript" : " 7.23.3" ,
46
+ "@rollup/plugin-babel" : " ^6.0.4" ,
46
47
"@rollup/plugin-json" : " 4.1.0" ,
47
48
"@rollup/plugin-node-resolve" : " 7.1.1" ,
48
49
"@rollup/plugin-replace" : " 2.3.3" ,
62
63
"babel-plugin-inline-replace-variables" : " 1.3.1" ,
63
64
"babel-plugin-module-resolver" : " 4.0.0" ,
64
65
"bundlesize2" : " 0.0.31" ,
65
- "concurrently" : " 5.3.0" ,
66
- "cross-env" : " 7.0.3" ,
67
66
"cssnano" : " 4.1.10" ,
68
67
"cypress" : " 9.6.1" ,
69
68
"dotenv" : " 16.3.1" ,
88
87
"react" : " 18.2.0" ,
89
88
"react-dom" : " 18.2.0" ,
90
89
"rollup" : " 1.32.1" ,
91
- "rollup-plugin-babel" : " 4.4.0" ,
92
90
"rollup-plugin-commonjs" : " 10.1.0" ,
91
+ "rollup-plugin-dts" : " ^6.1.1" ,
93
92
"rollup-plugin-filesize" : " 9.1.2" ,
94
93
"rollup-plugin-license" : " 3.2.0" ,
95
94
"rollup-plugin-terser" : " 7.0.2" ,
Original file line number Diff line number Diff line change 22
22
"jsdelivr" : " dist/umd/index.js" ,
23
23
"scripts" : {
24
24
"build:clean" : " rm -rf ./dist" ,
25
- "build:esm" : " cross-env BUILD=esm rollup --config" ,
26
- "build:types" : " tsc -p ./tsconfig.declaration.json --outDir ./dist/esm" ,
27
- "build:umd" : " cross-env BUILD=umd rollup --config" ,
28
- "build" : " yarn build:clean && yarn build:umd && yarn build:esm && yarn build:types" ,
29
- "on:change" : " concurrently \" yarn build:esm\" \" yarn build:types\" " ,
25
+ "build:types" : " tsc -p ./tsconfig.declaration.json --outDir ./dist/esm/types" ,
26
+ "build:clean-types" : " rm -rf ./dist/esm/types" ,
27
+ "build" : " yarn build:clean && yarn build:types && rollup --config && yarn build:clean-types" ,
28
+ "on:change" : " yarn build" ,
30
29
"watch" : " watch \" yarn on:change\" --ignoreDirectoryPattern \" /dist/\" "
31
30
},
32
31
"dependencies" : {
Original file line number Diff line number Diff line change 1
1
import replace from '@rollup/plugin-replace' ;
2
2
3
- import { plugins } from '../../rollup.base.config' ;
3
+ import { plugins , typesConfig } from '../../rollup.base.config' ;
4
4
import { getBundleBanner } from '../../scripts/getBundleBanner' ;
5
5
6
6
import pkg from './package.json' ;
7
7
8
- if ( ! process . env . BUILD ) {
9
- throw new Error ( 'The `BUILD` environment variable is required to build.' ) ;
10
- }
11
-
12
- const output = {
13
- umd : {
14
- file : 'dist/umd/index.js' ,
15
- format : 'umd' ,
16
- sourcemap : true ,
17
- name : 'docsearch' ,
18
- banner : getBundleBanner ( pkg ) ,
19
- } ,
20
- esm : {
21
- file : 'dist/esm/index.js' ,
22
- format : 'es' ,
23
- sourcemap : true ,
24
- banner : getBundleBanner ( pkg ) ,
8
+ export default [
9
+ {
10
+ input : 'src/index.ts' ,
11
+ output : [
12
+ {
13
+ file : 'dist/umd/index.js' ,
14
+ format : 'umd' ,
15
+ sourcemap : true ,
16
+ name : 'docsearch' ,
17
+ banner : getBundleBanner ( pkg ) ,
18
+ } ,
19
+ {
20
+ file : 'dist/esm/index.js' ,
21
+ format : 'es' ,
22
+ sourcemap : true ,
23
+ banner : getBundleBanner ( pkg ) ,
24
+ plugins : [ ...plugins ] ,
25
+ } ,
26
+ ] ,
27
+ plugins : [
28
+ ...plugins ,
29
+ replace ( {
30
+ 'process.env.NODE_ENV' : JSON . stringify ( 'production' ) ,
31
+ } ) ,
32
+ ] ,
25
33
} ,
26
- } ;
27
-
28
- export default {
29
- input : 'src/index.ts' ,
30
- output : output [ process . env . BUILD ] ,
31
- plugins :
32
- process . env . BUILD === 'umd'
33
- ? [
34
- ...plugins ,
35
- replace ( {
36
- 'process.env.NODE_ENV' : JSON . stringify ( 'production' ) ,
37
- } ) ,
38
- ]
39
- : plugins ,
40
- } ;
34
+ typesConfig ,
35
+ ] ;
Original file line number Diff line number Diff line change 1
- export { DocSearchButton } from './dist/esm/DocSearchButton.js ' ;
1
+ export { DocSearchButton } from './dist/esm' ;
Original file line number Diff line number Diff line change 1
- export { DocSearchModal } from './dist/esm/DocSearchModal.js ' ;
1
+ export { DocSearchModal } from './dist/esm' ;
Original file line number Diff line number Diff line change 25
25
"jsdelivr" : " dist/umd/index.js" ,
26
26
"scripts" : {
27
27
"build:clean" : " rm -rf ./dist" ,
28
- "build:esm" : " babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm" ,
29
- "build:types" : " tsc -p ./tsconfig.declaration.json --outDir ./dist/esm" ,
30
- "build:umd" : " rollup --config" ,
31
- "build" : " yarn build:clean && yarn build:umd && yarn build:esm && yarn build:types" ,
32
- "on:change" : " concurrently \" yarn build:esm\" \" yarn build:types\" " ,
28
+ "build:clean-types" : " rm -rf ./dist/esm/types" ,
29
+ "build:types" : " tsc -p ./tsconfig.declaration.json --outDir ./dist/esm/types" ,
30
+ "build" : " yarn build:clean && yarn build:types && rollup --config && yarn build:clean-types" ,
31
+ "on:change" : " yarn build" ,
33
32
"watch" : " watch \" yarn on:change\" --ignoreDirectoryPattern \" /dist/\" "
34
33
},
35
34
"dependencies" : {
Original file line number Diff line number Diff line change 1
1
import replace from '@rollup/plugin-replace' ;
2
2
3
- import { plugins } from '../../rollup.base.config' ;
3
+ import { plugins , typesConfig } from '../../rollup.base.config' ;
4
4
import { getBundleBanner } from '../../scripts/getBundleBanner' ;
5
5
6
6
import pkg from './package.json' ;
7
7
8
- export default {
9
- input : 'src/index.ts' ,
10
- external : [ 'react' , 'react-dom' ] ,
11
- output : {
12
- globals : {
13
- react : 'React' ,
14
- 'react-dom' : 'ReactDOM' ,
15
- } ,
16
- file : 'dist/umd/index.js' ,
17
- format : 'umd' ,
18
- sourcemap : true ,
19
- name : pkg . name ,
20
- banner : getBundleBanner ( pkg ) ,
8
+ export default [
9
+ {
10
+ input : 'src/index.ts' ,
11
+ external : [ 'react' , 'react-dom' ] ,
12
+ output : [
13
+ {
14
+ globals : {
15
+ react : 'React' ,
16
+ 'react-dom' : 'ReactDOM' ,
17
+ } ,
18
+ file : 'dist/umd/index.js' ,
19
+ format : 'umd' ,
20
+ sourcemap : true ,
21
+ name : pkg . name ,
22
+ banner : getBundleBanner ( pkg ) ,
23
+ } ,
24
+ { dir : 'dist/esm' , format : 'es' } ,
25
+ ] ,
26
+ plugins : [
27
+ ...plugins ,
28
+ replace ( {
29
+ 'process.env.NODE_ENV' : JSON . stringify ( 'production' ) ,
30
+ } ) ,
31
+ ] ,
21
32
} ,
22
- plugins : [
23
- ...plugins ,
24
- replace ( {
25
- 'process.env.NODE_ENV' : JSON . stringify ( 'production' ) ,
26
- } ) ,
27
- ] ,
28
- } ;
33
+ typesConfig ,
34
+ ] ;
Original file line number Diff line number Diff line change @@ -77,14 +77,14 @@ function ApplyForm() {
77
77
< Card className = "uil-m-auto uil-ta-center apply-form" >
78
78
{ state . message . startsWith ( 'Your DocSearch' ) ? (
79
79
< >
80
- < Heading1 className = "apply-text" > URL Already Submitted!</ Heading1 >
81
- < br />
82
- < Text
83
- className = "uil-pv-8 uil-d-block apply-text"
84
- aria-label = "Request has already been processed"
85
- >
86
- { state . message }
87
- </ Text >
80
+ < Heading1 className = "apply-text" > URL Already Submitted!</ Heading1 >
81
+ < br />
82
+ < Text
83
+ className = "uil-pv-8 uil-d-block apply-text"
84
+ aria-label = "Request has already been processed"
85
+ >
86
+ { state . message }
87
+ </ Text >
88
88
</ >
89
89
) : (
90
90
< >
Original file line number Diff line number Diff line change
1
+ import { babel } from '@rollup/plugin-babel' ;
1
2
import json from '@rollup/plugin-json' ;
2
3
import resolve from '@rollup/plugin-node-resolve' ;
3
4
import replace from '@rollup/plugin-replace' ;
4
- import babel from 'rollup-plugin-babel ' ;
5
+ import dts from 'rollup-plugin-dts ' ;
5
6
import filesize from 'rollup-plugin-filesize' ;
6
7
import { terser } from 'rollup-plugin-terser' ;
7
8
@@ -24,3 +25,9 @@ export const plugins = [
24
25
showGzippedSize : true ,
25
26
} ) ,
26
27
] ;
28
+
29
+ export const typesConfig = {
30
+ input : 'dist/esm/types/index.d.ts' ,
31
+ output : [ { file : 'dist/esm/index.d.ts' , format : 'es' } ] ,
32
+ plugins : [ dts ( ) ] ,
33
+ } ;
You can’t perform that action at this time.
0 commit comments