Skip to content

Commit

Permalink
Add some helpful comments to the rollup config.
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Sep 25, 2018
1 parent 95ff52b commit f7230ef
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,29 @@ import { terser } from 'rollup-plugin-terser'
import pkg from './package.json'

export default [
// CommonJS
{
input: 'src/index.js',
output: { file: 'lib/redux.js', format: 'cjs', indent: false },
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
...Object.keys(pkg.peerDependencies || {})
],
plugins: [
babel()
]
plugins: [babel()]
},

// ES
{
input: 'src/index.js',
output: { file: 'es/redux.js', format: 'es', indent: false },
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
...Object.keys(pkg.peerDependencies || {})
],
plugins: [
babel()
]
plugins: [babel()]
},

// ES for Browsers
{
input: 'src/index.js',
output: { file: 'es/redux.mjs', format: 'es', indent: false },
Expand All @@ -48,6 +49,8 @@ export default [
})
]
},

// UMD Development
{
input: 'src/index.js',
output: {
Expand All @@ -61,13 +64,15 @@ export default [
jsnext: true
}),
babel({
exclude: 'node_modules/**',
exclude: 'node_modules/**'
}),
replace({
'process.env.NODE_ENV': JSON.stringify('development')
})
]
},

// UMD Production
{
input: 'src/index.js',
output: {
Expand All @@ -81,7 +86,7 @@ export default [
jsnext: true
}),
babel({
exclude: 'node_modules/**',
exclude: 'node_modules/**'
}),
replace({
'process.env.NODE_ENV': JSON.stringify('production')
Expand Down

0 comments on commit f7230ef

Please sign in to comment.