Rollup scripts is a "zero config" bundler for JavaScript
and TypeScript
libraries.
Rollup scripts is designed to work out of the box for majority of JS
and TS
projects. It wraps the core functionality of Rollup
in a smart way, therefore
eliminating the need for setting up projects and configurations from scratch.
https://github.com/scssyworks/rollup-scripts/blob/main/ROADMAP.md
- Create an npm project
npm init -y
- Install
rollup-scripts
. NOTE: Do not install this package globally!
npm i -D --save-exact rollup-scripts
- If you are testing a forked repository:
npm i -D --save-exact github:{your username}/rollup-scripts
- Create an
src
folder and an entry fileindex.js
with a validJavaScript
code.
mkdir src
touch src/index.mjs
- Update
package.json
file as follows
{
"main": "dist/umd/index.js",
"module": "dist/esm/index.mjs",
"scripts": {
"build": "rollup-scripts build",
"lint": "rollup-scripts lint",
"init": "rollup-scripts init"
}
}
- Run command
npm run build
to compile the code.
Rollup scripts currently supports compilation for JavaScript
, TypeScript
,
React
and Preact
projects. We are working to add support for Angular
,
Vue
and Svelte
projects as well.
npx rollup-scripts build
Rollup-scripts supports init
, build
and lint
scripts. For more details
run:
npx rollup-scripts --help