🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@darcytech/html-webpack-tags-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@darcytech/html-webpack-tags-plugin

配置额外的 meta、 script、link 标签

latest
npmnpm
Version
1.2.4
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

@darcytech/html-webpack-tags-plugin

html-webpack-tags-plugin 是一款扩展至 html-webpack-plugin 的插件, 作用是在构建时往 head 和 body 插入额外的 script 和 link 标签。

Usage

const HtmlWebpackTagsPlugin = require('@darcytech/html-webpack-tags-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');

{
  plugins: [
    new HtmlWebpackPlugin(),
    new HtmlWebpackTagsPlugin({
      headScripts: {
        after: ['/a.js'],
        before: [{ src: '/b.js', defer: true }],
      },
      bodyScripts: {
        after: ['/c.js'],
        before: [{ src: '/d.js', defer: true }],
      },
      links: {
        after: [{ href: '/e.css', rel: 'stylesheet' }],
        before: [{ href: '/f.css', rel: 'stylesheet' }],
      },
    }),
  ];
}

Keywords

webpack

FAQs

Package last updated on 28 Nov 2023

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