W
W
Wasya UK2018-10-05 20:21:13
webpack
Wasya UK, 2018-10-05 20:21:13

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

1 answer(s)
V
Vitaly Stolyarov, 2018-10-05
@Ni55aN

Try

<link rel="import" href="<%= require('../partials/header.html') %>">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question