Skip to content

Double quotes are removed from the html file after compilation. #119

@diegoddox

Description

@diegoddox

Not sure why but I'm using the html-loader with html-webpack-plugin and for some reason the double quotes from the open graph are removed from the index.html output.

webpack -v 1.14.0
html-loader -v 0.4.5
html-webpack-plugin -v 2.28.0

A sample of my webpack config.

webpack.config.js

const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

let webpackBase = {
  target: 'web',
  entry: {
    'browser-entry': '/browser-entry.js'
  },
  output: {
    path: '/dist',
    filename: '[name].bundle.js',
    publicPath: '/'
  },
  module: {
    loaders: [{
        test: /\.js?$/,
        exclude: /node_modules/,
        loaders: ['babel']
      }]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: `!!html!./index.html`,
      hash: true,
      inject: 'body'
    })
  ]
};

module.exports = webpackBase;

And my index.html before compiled

index.html

<!DOCTYPE html>
<html>
<head>
  <meta property="og:title" content="" />
  <meta property="og:description" content="" />
</head>

<body>
  <div id="root"></div>
</body>
</html>

And after the compilation.

dist/index.html

<!DOCTYPE html>
<html>
<head>
  <meta property=og:title content="" />
  <meta property=og:description content="" />
</head>

<body>
  <div id="root"></div>
</body>
</html>

Note that all that has og: the double quote was removed, any idea why this is happening

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions