Skip to content

Commit

Permalink
Tweak HTML generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jul 17, 2016
1 parent 1d05ec3 commit e2f4942
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
13 changes: 11 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My React App</title>
<title>My First React App</title>
</head>
<body>
<!-- A lot of magic happens in this file. HtmlWebpackPlugin automatically includes all assets (e.g. bundle.js) with the correct HTML tags, which is why they are missing in this HTML file. -->
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` in this folder.
To create a production bundle, use `npm run build`.
-->
</body>
</html>
1 change: 0 additions & 1 deletion webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ module.exports = {
return [autoprefixer];
},
plugins: [
// TODO: infer from package.json?
new HtmlWebpackPlugin({
inject: true,
template: path.resolve(__dirname, relative, 'index.html'),
Expand Down
13 changes: 12 additions & 1 deletion webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,21 @@ module.exports = {
return [autoprefixer];
},
plugins: [
// TODO: infer from package.json?
new HtmlWebpackPlugin({
inject: true,
template: path.resolve(__dirname, relative, 'index.html'),
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true
}
}),
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }),
new webpack.optimize.OccurrenceOrderPlugin(),
Expand Down

0 comments on commit e2f4942

Please sign in to comment.