-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use rollup for more compact build output
- Loading branch information
1 parent
b553f0f
commit cae54bf
Showing
36 changed files
with
257 additions
and
141 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 |
---|---|---|
@@ -1,5 +1,28 @@ | ||
{ | ||
"presets": [ | ||
"react-native" | ||
"plugins": [ | ||
"syntax-async-functions", | ||
"syntax-class-properties", | ||
"syntax-trailing-function-commas", | ||
"transform-class-properties", | ||
"transform-es2015-function-name", | ||
"transform-es2015-arrow-functions", | ||
"transform-es2015-block-scoping", | ||
["transform-es2015-classes", { "loose": true }], | ||
"transform-es2015-computed-properties", | ||
"check-es2015-constants", | ||
"transform-es2015-destructuring", | ||
"transform-es2015-parameters", | ||
"transform-es2015-shorthand-properties", | ||
"transform-es2015-spread", | ||
"transform-es2015-template-literals", | ||
"transform-es2015-literals", | ||
"transform-flow-strip-types", | ||
"transform-object-assign", | ||
"transform-object-rest-spread", | ||
"transform-react-display-name", | ||
"transform-react-jsx", | ||
"transform-regenerator", | ||
["transform-es2015-for-of", { "loose": true }], | ||
"external-helpers" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ node_modules | |
.node_repl_history | ||
|
||
/lib | ||
/dist | ||
.DS_Store | ||
|
||
examples/interactive-docs/example.bundle.js |
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,61 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import replace from 'rollup-plugin-replace'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import uglify from 'rollup-plugin-uglify'; | ||
|
||
import pkg from './package.json'; | ||
|
||
function distBuild(options = {}) { | ||
return { | ||
input: 'src/index.js', | ||
output: { | ||
file: `dist/${options.filename}`, | ||
format: options.format, | ||
name: 'animated', | ||
sourcemap: options.sourcemap, | ||
}, | ||
plugins: [ | ||
babel({ | ||
exclude: ['node_modules/**'], | ||
}), | ||
replace({ | ||
'process.env.NODE_ENV': JSON.stringify('production'), | ||
}), | ||
resolve({ | ||
browser: true, | ||
}), // so rollup can find node modules | ||
commonjs(), // so rollup can convert node modules to ESM if needed | ||
options.minify && uglify(), | ||
] | ||
}; | ||
} | ||
|
||
function standardBuilds(filename) { | ||
return { | ||
input: `src/${filename}.js`, | ||
external: [ | ||
...Object.keys(pkg.dependencies), | ||
...Object.keys(pkg.peerDependencies) | ||
], | ||
output: [ | ||
{ file: `lib/${filename}.js`, format: 'cjs' }, | ||
{ file: `lib/${filename}.mjs`, format: 'es' }, | ||
], | ||
plugins: [ | ||
babel({ | ||
exclude: ['node_modules/**'], | ||
}), | ||
commonjs(), // so rollup can convert node modules to ESM if needed | ||
] | ||
}; | ||
} | ||
|
||
export default [ | ||
distBuild({ filename: 'animated.umd.js', format: 'umd', sourcemap: true, minify: false }), | ||
distBuild({ filename: 'animated.umd.min.js', format: 'umd', sourcemap: true, minify: true }), | ||
distBuild({ filename: 'animated.js', format: 'cjs', sourcemap: false, minify: false }), | ||
standardBuilds('index'), | ||
standardBuilds('targets/react-dom'), | ||
standardBuilds('targets/react-native'), | ||
]; |
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -38,4 +38,4 @@ class Animation { | |
} | ||
} | ||
|
||
module.exports = Animation; | ||
export default Animation; |
Oops, something went wrong.