html-webpack-inline-source-plugin
Embed javascript and css source inline when using the webpack dev server or middleware
Last updated 2 years ago by dustinjackson .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install html-webpack-inline-source-plugin 
SYNC missed versions from official npm registry.

Inline Source extension for the HTML Webpack Plugin

npm version Build status js-semistandard-style

Enhances html-webpack-plugin functionality by adding the {inlineSource: 'regex string'} option.

This is an extension plugin for the webpack plugin html-webpack-plugin (version 4 or higher). It allows you to embed javascript and css source inline.

Installation

You must be running webpack on node 6 or higher.

Install the plugin with npm:

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

Basic Usage

Require the plugin in your webpack config:

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

Add the plugin to your webpack config as follows:

plugins: [
  new HtmlWebpackPlugin(),
  new HtmlWebpackInlineSourcePlugin(HtmlWebpackPlugin)
]  

The above configuration will actually do nothing due to the configuration defaults.

When you set inlineSource to a regular expression the source code for any javascript or css file names that match will be embedded inline in the resulting html document.

plugins: [
  new HtmlWebpackPlugin({
		inlineSource: '.(js|css)$' // embed all javascript and css inline
	}),
  new HtmlWebpackInlineSourcePlugin(HtmlWebpackPlugin)
]  

Sourcemaps

If any source files contain a sourceMappingURL directive that isn't a data URI, then the sourcemap URL is corrected to be relative to the domain root (unless it already is) instead of to the original source file.

All sourcemap comment styles are supported:

  • //# ...
  • //@ ...
  • /*# ...*/
  • /*@ ...*/

Current Tags

  • 1.0.0-beta.2                                ...           beta (2 years ago)
  • 0.0.10                                ...           latest (2 years ago)

11 Versions

  • 1.0.0-beta.2                                ...           2 years ago
  • 0.0.10                                ...           2 years ago
  • 0.0.9                                ...           3 years ago
  • 0.0.8                                ...           3 years ago
  • 0.0.7                                ...           3 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 96
This Week 405
This Month 765
Last Day 113
Last Week 528
Last Month 1,771
Dependencies (3)
Dev Dependencies (9)
Dependents (137)

Copyright 2014 - 2017 © taobao.org |