Skip to content

Commit d7c5816

Browse files
TimvdLippetimdorr
authored andcommitted
Add ES-browser build (#3143)
* Add ES-browser build This build is intended for users who want to use Redux in a browser with ES modules support. The build removes all references to `process` by assuming it is in a production environment. Additionally, it does not transpile, as all browsers that have ES modules support also support ES2015+ * Build browser-compatible package in es folder * Remove unnecessary whitespace * Minify browser build * Rename to just redux.mjs
1 parent 9e0165c commit d7c5816

File tree

2 files changed

+51
-9
lines changed

2 files changed

+51
-9
lines changed

package-lock.json

Lines changed: 31 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ export default [
2828
babel()
2929
]
3030
},
31+
{
32+
input: 'src/index.js',
33+
output: { file: 'es/redux.mjs', format: 'es', indent: false },
34+
plugins: [
35+
nodeResolve({
36+
jsnext: true
37+
}),
38+
replace({
39+
'process.env.NODE_ENV': JSON.stringify('production')
40+
}),
41+
terser({
42+
compress: {
43+
pure_getters: true,
44+
unsafe: true,
45+
unsafe_comps: true,
46+
warnings: false
47+
}
48+
})
49+
]
50+
},
3151
{
3252
input: 'src/index.js',
3353
output: {

0 commit comments

Comments
 (0)