leanwebclub/structure-and-scale/seven-seas-page-specific-bundles
2024-09-02 10:50:21 +02:00
..
node_modules Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
src Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
bundle.js Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
dice.html Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
dice.js Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
index.html Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
index.js Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
package-lock.json Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
package.json Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
README.md Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
rollup.config.js Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
style.css Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
treasure.html Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +02:00
treasure.js Add Seven Seas - Page-Specific Bundles 2024-09-02 10:50:21 +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