@@ -3,28 +3,18 @@ import nodeResolve from '@rollup/plugin-node-resolve'
3
3
import babel from '@rollup/plugin-babel'
4
4
import replace from '@rollup/plugin-replace'
5
5
import typescript from 'rollup-plugin-typescript2'
6
- import { terser } from 'rollup-plugin-terser'
7
-
8
- import pkg from './package.json'
6
+ import terser from '@rollup/plugin-terser'
9
7
10
8
const extensions = [ '.ts' ]
11
9
const noDeclarationFiles = { compilerOptions : { declaration : false } }
12
10
13
- const babelRuntimeVersion = pkg . dependencies [ '@babel/runtime' ] . replace (
14
- / ^ [ ^ 0 - 9 ] * / ,
15
- ''
16
- )
17
-
18
- const external = [
19
- ...Object . keys ( pkg . dependencies || { } ) ,
20
- ...Object . keys ( pkg . peerDependencies || { } )
21
- ] . map ( name => RegExp ( `^${ name } ($|/)` ) )
11
+ const external = [ ]
22
12
23
13
export default defineConfig ( [
24
14
// CommonJS
25
15
{
26
16
input : 'src/index.ts' ,
27
- output : { file : 'lib/redux.js ' , format : 'cjs' , indent : false } ,
17
+ output : { file : 'dist/cjs/index.cjs ' , format : 'cjs' , indent : false } ,
28
18
external,
29
19
plugins : [
30
20
nodeResolve ( {
@@ -33,7 +23,7 @@ export default defineConfig([
33
23
typescript ( { useTsconfigDeclarationDir : true } ) ,
34
24
babel ( {
35
25
extensions,
36
- plugins : [ [ './scripts/mangleErrors.js ' , { minify : false } ] ] ,
26
+ plugins : [ [ './scripts/mangleErrors.cjs ' , { minify : false } ] ] ,
37
27
babelHelpers : 'bundled'
38
28
} )
39
29
]
@@ -42,7 +32,7 @@ export default defineConfig([
42
32
// ES
43
33
{
44
34
input : 'src/index.ts' ,
45
- output : { file : 'es/redux .js' , format : 'es' , indent : false } ,
35
+ output : { file : 'dist/ es/index .js' , format : 'es' , indent : false } ,
46
36
external,
47
37
plugins : [
48
38
nodeResolve ( {
@@ -51,7 +41,7 @@ export default defineConfig([
51
41
typescript ( { tsconfigOverride : noDeclarationFiles } ) ,
52
42
babel ( {
53
43
extensions,
54
- plugins : [ [ './scripts/mangleErrors.js ' , { minify : false } ] ] ,
44
+ plugins : [ [ './scripts/mangleErrors.cjs ' , { minify : false } ] ] ,
55
45
babelHelpers : 'bundled'
56
46
} )
57
47
]
@@ -60,7 +50,7 @@ export default defineConfig([
60
50
// ES for Browsers
61
51
{
62
52
input : 'src/index.ts' ,
63
- output : { file : 'es/redux.mjs' , format : 'es' , indent : false } ,
53
+ output : { file : 'dist/ es/redux.mjs' , format : 'es' , indent : false } ,
64
54
plugins : [
65
55
nodeResolve ( {
66
56
extensions
@@ -73,7 +63,7 @@ export default defineConfig([
73
63
babel ( {
74
64
extensions,
75
65
exclude : 'node_modules/**' ,
76
- plugins : [ [ './scripts/mangleErrors.js ' , { minify : true } ] ] ,
66
+ plugins : [ [ './scripts/mangleErrors.cjs ' , { minify : true } ] ] ,
77
67
skipPreflightCheck : true ,
78
68
babelHelpers : 'bundled'
79
69
} ) ,
0 commit comments