More Premium Hugo Themes Premium React Themes

Rollup Native Modules Boilerplate

A demo app showcasing the use of real JavaScript modules in production—complete with cross-browser fallbacks for legacy browsers.

Rollup Native Modules Boilerplate

A demo app showcasing the use of real JavaScript modules in production—complete with cross-browser fallbacks for legacy browsers.

Author Avatar Theme by philipwalton
Github Stars Github Stars: 224
Last Commit Last Commit: Sep 14, 2019 -
First Commit Created: Dec 18, 2023 -
Rollup Native Modules Boilerplate screenshot

Overview:

The Rollup Native Modules Boilerplate is a demo app that showcases the use of real JavaScript modules in production. It includes cross-browser fallbacks for legacy browsers and demonstrates techniques described in the article “Using Native JavaScript Modules in Production Today.”

Features:

  • Babel transforms, including JSX
  • CommonJS dependencies, such as react and react-dom
  • CSS dependencies
  • Asset hashing
  • Code splitting
  • Dynamic import with polyfill fallback
  • Module/nomodule fallback

Installation:

  1. Clone the repository.
  2. Run npm install to install all dependencies.
  3. To start a local server at http://localhost:3000, use the following command:
npm start
  1. If you want Rollup to monitor the code for changes and rebundle, use:
npm run dev
  1. To build the app without starting the development server, use:
npm run build
  1. By default, the app is started in development mode. To switch to production mode with minified output and a nomodule bundle, prefix any of the above commands with NODE_ENV=production.

Summary:

The Rollup Native Modules Boilerplate is an example of using real JavaScript modules in a production environment. It includes various features like Babel transforms, CommonJS dependencies, and code splitting. The installation process is straightforward, and the app can be run locally with the provided commands.