Use HTML webpack plugin for one less thing to worry about.
This commit is contained in:
parent
3fd5743abd
commit
6d8e01b476
@ -35,6 +35,7 @@
|
||||
"styletron-utils": "^2.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"webpack": "~3.8.1",
|
||||
"webpack-dev-server": "~2.9.2"
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/app.css">
|
||||
<title>Photos</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="/app.bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,6 +1,7 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, './src'),
|
||||
@ -31,10 +32,12 @@ module.exports = {
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
__DEV__: true
|
||||
}),
|
||||
new ExtractTextPlugin('app.css', { allChunks: true })
|
||||
new webpack.DefinePlugin({ __DEV__: true }),
|
||||
new ExtractTextPlugin('app.css', { allChunks: true }),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'index.template.html',
|
||||
inject: 'body'
|
||||
})
|
||||
],
|
||||
devtool: 'source-map'
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user