jantimon/html-webpack-plugin

Injected variable wrapped with double quotes

Rc85 opened this issue ยท 1 comments

Rc85 commented

Current behaviour ๐Ÿ’ฃ

Inject a string variable to my HTML file has double quotes around it.

Expected behaviour โ˜€๏ธ

Should not have double quotes.

Reproduction Example ๐Ÿ‘พ

Environment ๐Ÿ–ฅ

https://codesandbox.io/s/wild-night-mqm26?file=/webpack.config.js

  1. Create a new terminal
  2. Execute yarn start to run webpack serve
  3. Press refresh in the sandbox browser
  4. See "This is foo" wrapped in double quotes

The codesandbox uses webpack 5. The one I'm using in my development is webpack 4. Both have double quotes.

Rc85 commented

JSON.stringify adds the double quote.