Skip to content

pm-zy/webpack-inline-modern-source-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
]  

About

webpack-inline-modern-source-plugin

Resources

Stars

Watchers

Forks

Packages

No packages published