準備
$ mkdir rensyu
$ cd rensyu
$ pulp init
$ pulp browserify --to dist/index.js
package.json
{
"dependencies": {
....
},
"scripts": {
"build": "pulp build && pulp browserify --to dist/index.js"
}
}
dist/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script src="./index.js"></script>
</body>
</html>
$ live-server dist/
開発
以下のいずれかの方法でビルドすれば勝手にブラウザがリロードされます。
$ yarn build
または
$ npm run build