🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

outer-script-html-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

outer-script-html-webpack-plugin

Inject original js into html, without webpack compiler

1.1.2
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

outer-script-html-webpack-plugin

Inject original js into html, without webpack compiler.

Working with html-webpack-plugin and Webpack 3.

Install

$ npm install outer-script-html-webpack-plugin --save-dev

Usage

webpack.config.js

const HtmlWebpackPlugin = require('html-webpack-plugin')
const OuterScriptPlugin = require('outer-script-html-webpack-plugin')

module.exports = {
  ...
  output: {
    publicPath: '/public/'
  },
  plugins: [
    ...
    new OuterScriptPlugin(),
    new HtmlWebpackPlugin({
      ...
      outerScripts:[ 
        {
          chunk: '/absolute/path/to/a.js',
          filename: 'js/a.js'
        },
        {
          chunk: '/absolute/path/to/b.js',
          filename: 'js/b.[chunkhash].js'
        }
      ]
    })
  ]
}

ouput html:

  ...
  // original a.js and b.js without compiling will be injected here
  <script type="text/javascript" src="/public/js/a.js">
  <script type="text/javascript" src="/public/js/b.c57c86c1b956c3a01175.js">
  // 'outerScripts' will be injected before other scripts
  <script type="text/javascript" src="/public/others.js">
  ...

License

MIT

Keywords

html-webpack-plugin

FAQs

Package last updated on 07 Dec 2018

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