module: {
loaders: [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("style", "css!sass")
},
plugins: [
new ExtractTextPlugin("style.[hash].css", {
allChunks: true
}),
new HtmlWebpackPlugin({
template: 'src/client/index.html',
"assets": {
"client" : "client.[hash].js",
"style" : "style.[hash].css",
}
})
]
template:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>My App</title>
</head>
<body>
<link href="{%=o.htmlWebpackPlugin.assets.style%}" media="all" rel="stylesheet" type="text/css">
<script src="{%=o.htmlWebpackPlugin.assets.client%}"></script>
</body>
</html>
try:
<link rel="stylesheet" href="[prepend_your_public_path/]{%=o.webpack.assetsByChunkName.client[1]%}">
more details here: https://github.com/ampedandwired/html-webpack-plugin/issues/1
Thanks @bitplanets, some good ideas there, and apologies for not getting back to you sooner. I'm going to put a bit of work into making this a bit easier, as well as addressing the script ordering problem.
The pull-request #14 supports the ExtractTextPlugin
@jantimon's PR #14 allows for styles to be included, so closing this for now. Let me know if this doesn't meet your needs.
I think this could use some more explicit documentation. Especially in the use case of multiple chunks going to the the head and/or body.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I think this could use some more explicit documentation. Especially in the use case of multiple chunks going to the the head and/or body.