File tree 3 files changed +17
-88
lines changed
3 files changed +17
-88
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " react-tweeker-js" ,
3
3
"version" : " 1.4.0" ,
4
4
"description" : " A react wrapper for the tweeker embed script" ,
5
- "main" : " dist/index.cjs.js" ,
6
- "module" : " dist/index.esm.js" ,
5
+ "main" : " dist/index.js" ,
7
6
"files" : [
8
7
" dist"
9
8
],
24
23
"@babel/core" : " ^7.9.0" ,
25
24
"@babel/preset-env" : " ^7.9.0" ,
26
25
"@babel/preset-react" : " ^7.9.0" ,
27
- "@rollup/plugin-commonjs" : " ^11.0.2" ,
28
26
"@rollup/plugin-node-resolve" : " ^7.1.1" ,
29
27
"react" : " ^16.13.1" ,
30
28
"react-dom" : " ^16.13.1" ,
Original file line number Diff line number Diff line change 1
1
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
2
2
import babel from 'rollup-plugin-babel'
3
3
import resolve from '@rollup/plugin-node-resolve'
4
- import commonjs from '@rollup/plugin-commonjs'
5
4
import pkg from './package.json'
6
5
7
- const INPUT_FILE_PATH = 'src/index.js' ;
8
- const OUTPUT_NAME = 'ReactTweekerJs' ;
9
-
10
- const PLUGINS = [
11
- peerDepsExternal ( ) ,
12
- resolve ( ) ,
13
- commonjs ( {
14
- namedExports : {
15
- 'tweeker-js' : [ 'embedTweeker' ]
16
- }
17
- } ) ,
18
- babel ( {
19
- exclude : 'node_modules/**' ,
20
- } ) ,
21
- ]
22
-
23
- const GLOBALS = {
24
- react : 'React' ,
25
- 'react-dom' : 'ReactDOM' ,
26
- }
27
-
28
- const OUTPUT_DATA = [
29
- {
6
+ export default {
7
+ input : 'src/index.js' ,
8
+ output : {
30
9
file : pkg . main ,
31
- format : 'cjs' ,
32
- } ,
33
- {
34
- file : pkg . module ,
35
10
format : 'es' ,
11
+ name : 'ReactTweekerJs' ,
12
+ globals : {
13
+ react : 'React' ,
14
+ 'react-dom' : 'ReactDOM' ,
15
+ } ,
36
16
} ,
37
- ]
38
-
39
- const config = OUTPUT_DATA . map ( ( { file, format } ) => ( {
40
- input : INPUT_FILE_PATH ,
41
- output : {
42
- file,
43
- format,
44
- name : OUTPUT_NAME ,
45
- globals : GLOBALS ,
46
- } ,
47
- plugins : PLUGINS ,
48
- } ) )
49
-
50
- export default config
17
+ plugins : [
18
+ peerDepsExternal ( ) ,
19
+ resolve ( ) ,
20
+ babel ( {
21
+ exclude : 'node_modules/**' ,
22
+ } ) ,
23
+ ] ,
24
+ }
You can’t perform that action at this time.
0 commit comments