Description
The HTML output has an invalid doctype line like this:
This happens even with an extremely minimal configuration file, see below.
What type of issue is this? (place an x in one of the [ ])
Requirements (place an x in each of the [ ])
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
slackhq/csp-html-webpack-plugin version: 5.1.0
node version: v22.5.1
OS version(s): Arch Linux
Steps to reproduce:
$ git clone https://github.com/ttencate/csp-html-webpack-plugin_doctype_repro.git
$ cd csp-html-webpack-plugin_doctype_repro
$ yarn install
$ ./node_modules/.bin/webpack
$ head -n1 dist/index.html
Expected result:
Actual result:
Attachments:
package.json
{
"name": "repro",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"csp-html-webpack-plugin": "^5.1.0",
"html-webpack-plugin": "^5.6.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4"
}
}
webpack.config.js
const CspHtmlWebpackPlugin = require('csp-html-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
mode: 'development',
plugins: [
new HtmlWebpackPlugin(),
new CspHtmlWebpackPlugin(),
],
}
src/index.js
Description
The HTML output has an invalid doctype line like this:
<!DOCTYPE >This happens even with an extremely minimal configuration file, see below.
What type of issue is this? (place an
xin one of the[ ])Requirements (place an
xin each of the[ ])Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
slackhq/csp-html-webpack-plugin version: 5.1.0
node version: v22.5.1
OS version(s): Arch Linux
Steps to reproduce:
Expected result:
<!DOCTYPE html>Actual result:
<!DOCTYPE >Attachments:
package.json
{ "name": "repro", "version": "1.0.0", "main": "index.js", "license": "MIT", "devDependencies": { "csp-html-webpack-plugin": "^5.1.0", "html-webpack-plugin": "^5.6.0", "webpack": "^5.94.0", "webpack-cli": "^5.1.4" } }webpack.config.js
src/index.js
// Empty.