# 模板
# mix.html()
mix.html(input: string, output: string)
🌰 举个栗子:
const api = (mix) => {
mix.html('src/index.html', 'dist');
};
module.exports = (balm) => {
return {
config: {},
api
};
};
- 源模板
<!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>
- 生产文件
<!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>