Skip to content

Commit

Permalink
update package script
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Aug 23, 2017
1 parent c6233e3 commit 895a4d8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build-main": "cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config ./config/webpack.config.electron.js --progress --profile --colors",
"build-renderer": "cross-env NODE_ENV=production node -r babel-register ./node_modules/webpack/bin/webpack --config ./config/webpack.config.production.js --progress --profile --colors",
"build": "rm -rf dist && npm run build-main && npm run build-renderer",
"package": "npm run build && rm -rf release && build --publish always --projectDir ./dist",
"package": "npm run build && rm -rf release && build --projectDir ./dist",
"hot-server": "cross-env NODE_ENV=development node -r babel-register scripts/dev.js",
"start-hot": "cross-env HOT=1 NODE_ENV=development ./node_modules/.bin/electron -r babel-register -r babel-polyfill ./main",
"dev": "concurrently --kill-others \"npm run hot-server\" \"npm run start-hot\""
Expand Down
28 changes: 28 additions & 0 deletions src/index.dev.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>weweChat</title>
<script>
if (!process.env.HOT) {
let link = document.createElement('link')
link.rel = 'stylesheet'
link.href = '../dist/style.css'
document.write(link.outerHTML)
}
</script>
</head>
<body>
<div id="root"></div>
<script>
{
let script = document.createElement('script')
let port = process.env.PORT || 3000
script.async = ''
script.src = (process.env.HOT) ? `http://localhost:${port}/dist/bundle.js` : '../dist/bundle.js'
document.body.appendChild(script)
}
</script>
</body>
</html>

0 comments on commit 895a4d8

Please sign in to comment.