-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: bundle UMD with rollup (#449)
* Bundle UMD with rollup ```diff -Webpack production bundle is 18407b (no gzip) +Rollup production bundle is 14975b (no gzip) ``` * Fix lint * Compile to lib/dist * Build for production instead * Uncomment terser
- Loading branch information
Showing
6 changed files
with
301 additions
and
1,367 deletions.
There are no files selected for viewing
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,12 @@ | ||
{ | ||
"./lib/dist/react-transition-group.js": { | ||
"bundled": 79410, | ||
"minified": 22589, | ||
"gzipped": 6905 | ||
}, | ||
"./lib/dist/react-transition-group.min.js": { | ||
"bundled": 46139, | ||
"minified": 14975, | ||
"gzipped": 4685 | ||
} | ||
} |
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,64 @@ | ||
import nodeResolve from "rollup-plugin-node-resolve"; | ||
import babel from "rollup-plugin-babel"; | ||
import commonjs from "rollup-plugin-commonjs"; | ||
import replace from "rollup-plugin-replace"; | ||
import { sizeSnapshot } from "rollup-plugin-size-snapshot"; | ||
import { terser } from "rollup-plugin-terser"; | ||
|
||
const input = "./src/umd.js"; | ||
const name = "ReactTransitionGroup"; | ||
const globals = { | ||
react: "React", | ||
"react-dom": "ReactDOM" | ||
}; | ||
|
||
const babelOptions = { | ||
exclude: /node_modules/, | ||
runtimeHelpers: true | ||
} | ||
|
||
const commonjsOptions = { | ||
include: /node_modules/, | ||
namedExports: { | ||
"prop-types": ["object", "oneOfType", "element", "bool", "func"] | ||
} | ||
}; | ||
|
||
export default [ | ||
{ | ||
input, | ||
output: { | ||
file: "./lib/dist/react-transition-group.js", | ||
format: "umd", | ||
name, | ||
globals | ||
}, | ||
external: Object.keys(globals), | ||
plugins: [ | ||
nodeResolve(), | ||
babel(babelOptions), | ||
commonjs(commonjsOptions), | ||
replace({ "process.env.NODE_ENV": JSON.stringify("development") }), | ||
sizeSnapshot() | ||
] | ||
}, | ||
|
||
{ | ||
input, | ||
output: { | ||
file: "./lib/dist/react-transition-group.min.js", | ||
format: "umd", | ||
name, | ||
globals | ||
}, | ||
external: Object.keys(globals), | ||
plugins: [ | ||
nodeResolve(), | ||
babel(babelOptions), | ||
commonjs(commonjsOptions), | ||
replace({ "process.env.NODE_ENV": JSON.stringify("production") }), | ||
sizeSnapshot(), | ||
terser() | ||
] | ||
} | ||
]; |
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,4 @@ | ||
export { default as CSSTransition } from './CSSTransition'; | ||
export { default as ReplaceTransition } from './ReplaceTransition'; | ||
export { default as TransitionGroup } from './TransitionGroup'; | ||
export { default as Transition } from './Transition'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.