You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@effortlessmotion/html-webpack-inline-source-plugin

Package Overview
Dependencies
3
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effortlessmotion/html-webpack-inline-source-plugin

Embed javascript and css source inline when using the webpack dev server or middleware


Version published
Maintainers
1
Created

Readme

Source

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.

Warning: This module is a fork from https://github.com/dustinjackson/html-webpack-inline-source-plugin to support Webpack 5.

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

Installation

You must be running webpack on node 10 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()
]  

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

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:

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

Keywords

FAQs

Package last updated on 24 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc