2.5.26 • Published 21 days ago
@dumlj/html-enhance-webpack-plugin v2.5.26
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
2.5.27-alpha.1713365667.0
21 days ago
2.5.26-alpha.1710126501.0
2 months ago
2.5.26
2 months ago
2.5.26-alpha.1709143224.0
2 months ago
2.5.26-alpha.1709136968.0
2 months ago
2.5.25-alpha.1709135426.0
2 months ago
2.5.25
3 months ago
2.5.23
3 months ago
2.5.24
3 months ago
2.5.23-alpha.1707383866.0
3 months ago
2.5.23-alpha.1707390213.0
3 months ago
2.5.23-alpha.1707401616.0
3 months ago
2.5.23-alpha.1707244387.0
3 months ago
2.5.23-alpha.1707282212.0
3 months ago
2.5.23-alpha.1707248747.0
3 months ago
2.5.23-alpha.1707245597.0
3 months ago
2.5.23-alpha.1707287569.0
3 months ago
2.5.23-alpha.1707212485.0
3 months ago
2.5.22
4 months ago
2.5.21
4 months ago
2.5.20
5 months ago
2.5.19
5 months ago
2.5.18
5 months ago