This repository was archived by the owner on Jun 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-19
lines changed Expand file tree Collapse file tree 1 file changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import replace from 'rollup-plugin-replace'
44
55import pkg from './package.json'
66
7- const defaultConfig = Object . freeze ( {
7+ const defaultConfig = {
88 input : 'lib/index.js' ,
99 external : [ 'react' , 'react-dom' , 'prop-types' ] ,
1010 plugins : [
@@ -16,40 +16,35 @@ const defaultConfig = Object.freeze({
1616 } ) ,
1717 terser ( )
1818 ]
19- } )
20-
21- const createConfig = mutator => {
22- const config = { ...defaultConfig }
23- return mutator ( config )
2419}
2520
21+ const createConfig = ( config ) => ( {
22+ ...defaultConfig ,
23+ ...config
24+ } )
25+
2626export default [
27- createConfig ( config => {
28- config . output = {
27+ createConfig ( {
28+ output : {
2929 file : 'dist/' + pkg . module ,
3030 format : 'esm'
3131 }
32- return config
3332 } ) ,
34- createConfig ( config => {
35- config . output = {
33+ createConfig ( {
34+ output : {
3635 file : 'dist/' + pkg . main ,
3736 format : 'cjs'
3837 }
39- return config
4038 } ) ,
41- createConfig ( config => {
42- config . experimentalCodeSplitting = true
43- config . optimizeChunks = true
44- config . input = [
39+ createConfig ( {
40+ input : [
4541 './lib/List' ,
4642 './lib/Show' ,
4743 './lib/Switch'
48- ]
49- config . output = {
44+ ] ,
45+ output : {
5046 dir : 'dist' ,
5147 format : 'cjs'
5248 }
53- return config
5449 } )
5550]
You can’t perform that action at this time.
0 commit comments