soakit / inline-source-webpack-plugin

inline-source-webpack-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inline-source-webpack-plugin

Inline all <script>, <link> and <img> tags that contain the inline attribute with inline-source.

Installation

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

Basic Usage

Require the plugin in your webpack config:

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

Add the plugin to your webpack config as follows:

plugins: [
  new HtmlWebpackPlugin(),
  new InlineSourceWebpackPlugin()
  /*
  // option
  new InlineSourceWebpackPlugin({
    // the option with https://github.com/popeindustries/inline-source
  }) 
  */
]  

Add the tag to your html template as follows:

<!DOCTYPE html>
<html>
  <head>
    <script inline src="your_file.js"></script>
  </head>
  <body>
  </body>
</html>

About

inline-source-webpack-plugin


Languages

Language:JavaScript 100.0%