leanwebclub/structure-and-scale/seven-seas-bundlers/README.md

695 B

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