I have a template file which I use to generate the final output html file using the html-webpack-plugin. Is there a way to include referenced local files when generating the final file?
I have the following file structure:
.\public\index.html
.\public\css\site.css
Here is an index.html template file:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title><%= htmlWebpackPlugin.options.title %></title>
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
<div id="app"></div>
</body>
</html>
Inside the webpack.config.js I have the following:
....
plugins: [
new HtmlWebpackPlugin({
template: './public/index.html'
})
]
...
This will generate the .\dist\index.html file, however it will not copy over the .\public\css\main.css into .\dist\css\main.css.
Is there a way to do this?