I have this webpack.config.js:
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = [{
entry: ['./app/clientside/app.scss', './app/clientside/app.js'],
plugins: [
new HtmlWebpackPlugin({
title: 'Caching',
}),
],
output: {
path: __dirname + '/private_html/_app/dist',
publicPath: '',
filename: '[contenthash].bundle.js'
},
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: 'file-loader',
options: {
name: '[contenthash].bundle.css',
},
},
{ loader: 'extract-loader' },
{ loader: 'css-loader' },
{ loader: 'postcss-loader',
options: {
plugins: () => [autoprefixer()]
}
},
{
loader: 'sass-loader',
options: {
implementation: require('sass'),
sassOptions: {
includePaths: ['./node_modules']
}
}
},
]
},
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
] },
}];
The css and js files are generated, but in the index.html only the js file is included:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Caching</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<script src="dd9a13efe757661de1fe.bundle.js"></script>
</body>
</html>
I expected to have link-element referencing the css file. I tried google but can't seem to find the right direction/ keywords. How do I fix this?