webpack-module-nomodule-plugin

Automates the integration of module/nomodule bundles in your html.


Keywords
webpack, plugin, module, nomodule, html-webpack-plugin, module-nomodule
License
MIT
Install
npm install webpack-module-nomodule-plugin@1.1.0

Documentation

Webpack module-nomodule plugin

npm version

Installation

npm install --save-dev webpack-module-nomodule-plugin

or

yarn add -D webpack-module-nomodule-plugin

Why

This automates the generation of module-nomodule scripts.

This project relies on html-webpack-plugin.

module-nomodule explained.

How to use

The only thing you need to do is return two build steps in your webpack and forward this to this plugin like this:

  • for legacy new WebpackModuleNomodulePlugin({ mode: 'legacy' });
  • for modern new WebpackModuleNomodulePlugin({ mode: 'modern' });

The rest will be handled for you!

Example

https://github.com/JoviDeCroock/POC-ModularLegacyBuild

This example uses multiple techniques to guarantee the best size, like using native-url in modern browsers, ...