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