1.0.6 • Published 5 years ago
html-webpack-extra-tags-plugin v1.0.6
npm i --save-dev html-webpack-extra-tags-plugin
yarn add --dev html-webpack-extra-tags-plugin
webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackExtraTagsPlugin = require('html-webpack-extra-tags-plugin')
module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackExtraTagsPlugin(),
]
}
This will generate a file dist/webpack-css.html,webpack-js.html
containing the following
<link href="xxx.css"></link>
<script src="bundle.js"></script>
Name | Type | Default | Description |
---|---|---|---|
outputPath | {String} | ./ | set output path |
eg:
{
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackExtraTagsPlugin({ outputPath: path.resolve(__dirname, 'xxxx') }),
]
}