leanwebclub/structure-and-scale/seven-seas-cache-strategy
2024-09-11 07:49:16 +02:00
..
node_modules Add service worker projects 2024-09-09 17:55:31 +02:00
public Add service worker projects 2024-09-09 17:55:31 +02:00
src Add service worker projects 2024-09-09 17:55:31 +02:00
dice.html Add service worker projects 2024-09-09 17:55:31 +02:00
index.html Add service worker projects 2024-09-09 17:55:31 +02:00
package-lock.json Add service worker projects 2024-09-09 17:55:31 +02:00
package.json Add service worker projects 2024-09-09 17:55:31 +02:00
README.md Add service worker projects 2024-09-09 17:55:31 +02:00
rollup.config.js Add service worker projects 2024-09-09 17:55:31 +02:00
sw.js Improve cache fetching 2024-09-11 07:49:16 +02:00
treasure.html Add service worker projects 2024-09-09 17:55:31 +02:00

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