Getting started with Rollup
Getting started with Rollup
This repository is following along with the video tutorial series from Jason Lengstorf which can be found here. There is a starter repository that can be found here.
A breakdown about the rollup.config.js
can be found in learn.js
. It is much different than the actual rollup.config.js
as I was trying to make it as streamline as possible. Still wanting to find a way to process the whole library build with just one configuration and one script. learn.js
is commented out and has links to the plugin repositories. Note that the mini-library does not use external packages hence no need for node-resolve
in either of the configs.
yarn build # generates all distributions of the code.
yarn output # packages code & opens for local use.
yarn sandbox # executes library's code.
yarn run clean # removes all generated files.
When creating the rollup.config.js
write in ES6, rollup
expects this! Your ability to write certain features of ES6 will be dependant on your systems current node --v
.
Rollup
does tree-shaking by default! If a module is not being used it will not be included in the bundled code.
Order of plugins matters!!!
Unfortunately babelrc-rollup
does not accept an argument for specific environments or I would use this approach to resolve my issue of having all the builds processed by one config and one script.
Currently to remove all comments:
cleanup() // remove all comments, etc.
// or
cleanup({ comments: ['jsdoc'] }); // too leave jsdoc comments.
but I still will get the comments from non-exported functions.
rollup.config.js
& one npm script.
rollup-plugin-multidest
is a sound option; but I have not been able to incorporate thees
build with this and still get the expected results throughout all files.BABEL_ENV=cjs
is needed for all commonjs builds and I don’t want babel touching my code when buildinges
.Solved in this commit.