🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More β†’
Socket
Book a DemoSign in
Socket

@dumlj/html-enhance-webpack-plugin

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dumlj/html-enhance-webpack-plugin

Basic plugin use for enhance html webpack plugin.

latest
Source
npmnpm
Version
2.5.26
Version published
Weekly downloads
77
3750%
Maintainers
3
Weekly downloads
Β 
Created
Source

License: MITΒ  Github RepoΒ  NPM VersionΒ  See DocsΒ  codecovΒ 

Html Enhance Webpack Plugin

Basic plugin use for enhance html webpack plugin.

BACKGROUND

INSTALL

# use npm
$ npm install --dev @dumlj/html-enhance-webpack-plugin
# use yarn
$ yarn add --dev @dumlj/html-enhance-webpack-plugin
# use pnpm
$ pnpm add @dumlj/html-enhance-webpack-plugin -D

USAGE

import { HtmlEnhanceWebpackPlugin } from '@dumlj/html-enhance-webpack-plugin'
import HtmlWebpackPlugin from 'html-webpack-plugin'

const htmlWebpackPluginInstance = new HtmlWebpackPlugin()
const htmlEnhancePluginInstance = new HtmlEnhanceWebpackPlugin({
  /** html filename of output */
  htmlNS: 'index.html',
  /** html-webpack-plugin **/
  HtmlWebpackPlugin: HtmlWebpackPlugin,
  /** instance of html-webpack-plugin */
  htmlWebpackPluginInstance: htmlWebpackPluginInstance,
})

// inject tags anywhrere
htmlEnhancePluginInstance.injectTags({
  scriptTags: [
    {
      url: 'https://cdn.dumlj.io//some.js',
    },
  ],
})

export default {
  // ....
  plugins: [
    htmlWebpackPluginInstance,
    htmlEnhancePluginInstance,
    // inject tags by inheritance
    new (class extends HtmlEnhanceWebpackPlugin {
      apply(compiler: Compiler) {
        super.apply(compiler)

        this.injectTags({
          // inject styles
          styleTags: [
            {
              url: 'https://cdn.dumlj.io/some.css',
            },
          ],
        })
      }
    })({
      /** html filename of output */
      htmlNS: 'index.html',
      /** html-webpack-plugin **/
      HtmlWebpackPlugin: HtmlWebpackPlugin,
      /** instance of html-webpack-plugin */
      htmlWebpackPluginInstance: htmlWebpackPluginInstance,
    }),
  ],
}

LIVE DEMO

INTERNAL DEPENDENCIES

@dumlj/html-enhance-webpack-plugin
β”œβ”€β”¬ @dumlj/seed-webpack-plugin
β”‚ β”œβ”€β”¬β”€ @dumlj/feature-updater
β”‚ β”‚ β”œβ”€β”€β”€ @dumlj/shell-lib
β”‚ β”‚ β”œβ”€β”€β”€ @dumlj/util-lib
β”‚ β”‚ └─── @dumlj/mock-libPRIVATE
β”‚ └─── @dumlj/mock-libPRIVATE
└── @dumlj/util-lib

FAQs

Package last updated on 11 Mar 2024

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