Add support for es module build (#1374)

This commit is contained in:
Adrien Denat
2019-06-21 09:43:05 -06:00
committed by Tanner Linsley
parent 5369051b05
commit e4429b7143
2 changed files with 32 additions and 23 deletions
+2 -2
View File
@@ -15,8 +15,8 @@
"datagrid"
],
"main": "dist/index.js",
"_module": "dist/index.es.js",
"_jsnext:main": "dist/index.es.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
"scripts": {
"test": "cross-env CI=1 react-scripts test --env=jsdom",
"test:watch": "react-scripts test --env=jsdom",
+30 -21
View File
@@ -6,27 +6,36 @@ import { uglify } from 'rollup-plugin-uglify'
import pkg from './package.json'
export default {
input: 'src/index.js',
output: [
{
export default [
{
input: 'src/index.js',
output: {
file: pkg.main,
format: 'cjs',
sourcemap: true
}
// {
// file: pkg.module,
// format: "es",
// sourcemap: true
// }
],
plugins: [
external(),
babel({
exclude: 'node_modules/**'
}),
resolve(),
commonjs(),
uglify()
]
}
},
plugins: [
external(),
babel({
exclude: 'node_modules/**'
}),
resolve(),
commonjs(),
uglify()
]
},
{
input: 'src/index.js',
external: Object.keys(pkg.peerDependencies),
output: {
file: pkg.module,
format: 'es',
sourcemap: true
},
plugins: [
babel({
exclude: ['/**/node_modules/**']
})
]
}
]