# Template

# mix.html()

mix.html(input: string, output: string)

🌰 For example:

const api = (mix) => {
  mix.html('src/index.html', 'dist');
};

module.exports = (balm) => {
  return {
    config: {},
    api
  };
};
  • before
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Hello BalmJS</title>
    <link rel="stylesheet" href="%PUBLIC_URL%/styles/main.css" />
  </head>

  <body>
    <div id="app">
      <span>Hello</span>
      <img src="%PUBLIC_URL%/images/logo.svg" alt="BalmJS" />
      <a href="//balm.js.org/">BalmJS</a>
    </div>

    <script src="%PUBLIC_URL%/scripts/main.js"></script>
  </body>
</html>
  • after
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Hello BalmJS</title>
    <link rel="stylesheet" href="/css/main.css" />
  </head>

  <body>
    <div id="app">
      <span>Hello</span>
      <img src="/img/logo.svg" alt="BalmJS" />
      <a href="//balm.js.org/">BalmJS</a>
    </div>

    <script src="/js/main.js"></script>
  </body>
</html>
Last Updated: 4 years ago