Skip to content

Commit

Permalink
use bel instead of create-html
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhanseng committed Oct 10, 2017
1 parent 8c470ef commit 0acef05
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 15 additions & 7 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var fs = require('fs')
var mkdirp = require('mkdirp')
var browserify = require('browserify')
var createHTML = require('create-html')
var html = require('bel')

var b = browserify()

Expand All @@ -13,13 +13,21 @@ mkdirp('./build', ()=>{
console.log('create bundle.js')
})

var html = createHTML({
title: "choo-scriber",
script: "bundle.js",
body: "<div></div>",
})
var indexHtml = html`
<!doctype html>
<html lang="en" dir="ltr">
<head>
<title>choo-scriber</title>
<meta charset="utf-8">
</head>
<body>
<div></div>
<script src="bundle.js"></script>
</body>
</html>
`

fs.writeFile('./build/index.html', html, ()=>{
fs.writeFile('./build/index.html', indexHtml, ()=>{
console.log('create index.html')
})
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"yuki-createjs": "0.0.3"
},
"devDependencies": {
"bel": "^5.1.3",
"brfs": "^1.4.3",
"browserify": "^14.4.0",
"budo": "^10.0.4",
"create-html": "^4.0.0",
"mkdirp": "^0.5.1",
"uglifyify": "^4.0.4"
},
Expand Down

0 comments on commit 0acef05

Please sign in to comment.