📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

js-create-includes-webpack-plugin

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-create-includes-webpack-plugin

Making WebPack includes creating with JS createElement

0.0.3
Version published
Weekly downloads
15
87.5%
Maintainers
1
Weekly downloads
 
Created

JSCreateIncludesWebpackPlugin

The simple plug-in which allows you to run cordova/webpack app.

Overview

The WebPack plugin for convert HTML script assignment like:

<script src="/bundle.js"></script>

to JS creation of a DOM-element:

<script>
  const bundleScript = document.createElement('script');
  bundleScript.type = 'text/javascript';
  bundleScript.async = true;
  bundleScript.src = 'bundle.js';
  document.body.appendChild(bundleScript);
</script>

Installation

Requirements:
  • webpack
  • html-webpack-plugin
$ npm i js-create-includes-webpack-plugin -D

Usage

Add to you WebPack config file the next:

const JSCreateIncludesWebpackPlugin = require('js-create-includes-webpack-plugin')

// ...

module.exports = {
  plugins: [
    // Place it after HtmlWebpackPlugin
    new JSCreateIncludesWebpackPlugin(),
  ],
}

Credits

Author: Denis Efremov @piterden

FAQs

Package last updated on 12 Oct 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