-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(browser): build a dedicated version for the browser
BREAKING CHANGE: This PR change of the internal directory structure of the exported code. The previous code has move from the `dist/` into the `dist/esm` directory (but remender that we do not avice you to do this 🤓)
- Loading branch information
1 parent
2357eb7
commit d2d78d7
Showing
5 changed files
with
693 additions
and
16 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import flow from 'rollup-plugin-flow'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import builtins from 'rollup-plugin-node-builtins'; | ||
import globals from 'rollup-plugin-node-globals'; | ||
|
||
export default { | ||
input: 'src/index.js', | ||
output: { | ||
file: 'dist/cjs/bundle.js', | ||
format: 'cjs', | ||
}, | ||
sourcemap: true, | ||
plugins: [ | ||
babel({ | ||
babelrc: false, | ||
exclude: 'node_modules/**', // only transpile our source code | ||
presets: [ | ||
[ | ||
'es2015', | ||
{ | ||
modules: false, | ||
}, | ||
], | ||
'stage-2', | ||
'react', | ||
'flow', | ||
], | ||
plugins: ['external-helpers'], | ||
externalHelpers: true, | ||
}), | ||
resolve({ | ||
module: true, | ||
jsnext: true, | ||
main: true, | ||
browser: true, | ||
}), | ||
commonjs({ | ||
sourceMap: true, | ||
namedExports: { | ||
react: ['isValidElement'], | ||
}, | ||
}), | ||
globals(), | ||
builtins(), | ||
flow(), | ||
], | ||
}; |
Oops, something went wrong.