5.0.1 • Published 1 year ago

html-webpack-top-banner-plugin v5.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

html-webpack-top-banner-plugin

This is an extension plugin for the webpack 5/4 plugin html-webpack-plugin - a plugin that simplifies the creation of HTML files to serve your webpack bundles.

Adds a banner to the top of generated html.

Installation

webpack 5

Install the plugin with npm:

$ npm install -d html-webpack-top-banner-plugin
$ yarn add -D html-webpack-top-banner-plugin

webpack 4

Install the plugin with npm:

$ npm install -d html-webpack-top-banner-plugin@webpack-4
$ yarn add -D html-webpack-top-banner-plugin@webpack-4

Basic Usage

Load the plugin.

const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackTopBannerPlugin = require('html-webpack-top-banner-plugin')

And add it to your webpack config as follows:

plugins: [
  new HtmlWebpackPlugin(),
  new HtmlWebpackTopBannerPlugin('hello world'),
]

You will get the following results:

<!--
hello world
-->
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Webpack App</title>
  </head>
  <body></body>
</html>

Options

new HtmlWebpackTopBannerPlugin(options)

options: string | string[] |
    { banner: string | string[] }

Enter a string or array as follows:

new HtmlWebpackTopBannerPlugin('hello world')
// If you enter an array, it will be automatically converted to a string separated by '\n'.
new HtmlWebpackTopBannerPlugin(['hello world'])

Or enter a object as follows:

(New features will be added in the future)

new HtmlWebpackTopBannerPlugin({ banner: 'hello world' })
new HtmlWebpackTopBannerPlugin({ banner: ['hello world'] })

License

MIT

5.0.1

1 year ago

5.0.0

1 year ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago