Answer the question
In order to leave comments, you need to log in
How to work with links in webpack?
How to make the page find its additional part? In webpack I use HTMLWebpackPlugin.
new HtmlWebpackPlugin({
inject: false,
template: path.resolve(__dirname, `../examples/html/pages/${file}`),
filename: file
})
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Examples</title>
<script src="bundle.js"></script>
</head>
<body>
<link rel="import" href="../partials/header.html">
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Try
<link rel="import" href="<%= require('../partials/header.html') %>">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question