.. | ||
node_modules | ||
public | ||
src | ||
dice.html | ||
index.html | ||
offline.html | ||
package-lock.json | ||
package.json | ||
README.md | ||
rollup.config.js | ||
sw.js | ||
treasure.html |
Project: Seven Seas - Bundle
Using rollup.js
, bundle the modularized JavaScript files into an
IIFE that can be run in the browser without the performance issues
associated with the native ES modules.
Installing and Using Rollup
To install rollup
globally:
npm install --global rollup
To run rollup
:
rollup index.js --file bundle.js --format iife
To configure package.json
and install rollup
locally:
npm install rollup --save-dev
Update your package.json
:
{
"type": "module",
"devDependencies": {
"rollup": "^4.21.2"
},
"scripts": {
"js": "rollup --config"
}
}
Run the script:
npm run js