webpack-inline-modern-source-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

webpack-inline-modern-source-plugin

npm version

An extension plugin for the webpack plugin html-webpack-plugin.It allows you to embed css and ES6 or legacy-js sources inline as you choose.

If you don't use modern mode, html-webpack-inline-source-plugin maybe a better choice.

Installation

Required node 6 or higher.

Install:

$ npm install --save-dev webpack-inline-modern-source-plugin

Basic Usage

Require the plugin in your webpack config:

var WebpackInlineMordernSourcePlugin = require('webpack-inline-modern-source-plugin');

Add the plugin to your webpack config:

plugins: [
  new HtmlWebpackPlugin({
      inlineSource: '.(js|css)$'
  }),
  new WebpackInlineMordernSourcePlugin()
]  

It will embed all js and css sources inline. If you want to embed modern chunks or legacy chunks only, use inlineLegacy or inlineModern:

plugins: [
  new HtmlWebpackPlugin({
      inlineSource: '.(js|css)$',
      inlineLegacy: false, // default value: true
      inlineModern: true, // default value: true
  }),
  new WebpackInlineMordernSourcePlugin()
]  

Package Sidebar

Install

npm i webpack-inline-modern-source-plugin

Weekly Downloads

3

Version

0.1.4

License

ISC

Unpacked Size

6.95 kB

Total Files

4

Last publish

Collaborators

  • panda_m