Add webpack #1

Merged
hanneshdc merged 4 commits from :webpack into master 2017-11-10 09:43:53 +00:00
2 changed files with 5 additions and 13 deletions
Showing only changes of commit ab89f5f93f - Show all commits

View File

@ -28,20 +28,12 @@ clean:
rm -f ./bindata.go
bindata.go: client client/*
rm -fr ./clientpack
cp -r ./client ./clientpack
( echo ';(function() {' ; cat clientpack/dcwebui.js ; echo '})();' ) | uglifyjs -o clientpack/dcwebui.min.js -c -m --ie8
lessc --clean-css clientpack/dcwebui.css clientpack/dcwebui.min.css
cat clientpack/index.htm \
| sed -e '/dcwebui.css/{i <style>' -e 'r clientpack/dcwebui.min.css' -e 'a </style>' -e 'd}' \
| sed -e '/dcwebui.js/{i <script>' -e 'r clientpack/dcwebui.min.js' -e 'a </script>' -e 'd}' \
| sed -e '/socket.io-1.7.2.js/{i <script>' -e 'r clientpack/socket.io-1.7.2.js' -e 'a </script>' -e 'd}' \
> clientpack/index.packed.htm
mv clientpack/index.packed.htm clientpack/index.htm
npm run webpack
cat client/index.htm \
| sed -e '/bundle.js/{i <script>' -e 'r clientpack/bundle.min.js' -e 'a </script>' -e 'd}' \
> clientpack/index.htm
html-minifier --collapse-whitespace -o clientpack/index.min.htm clientpack/index.htm
mv clientpack/index.min.htm clientpack/index.htm
rm ./clientpack/*.js
rm ./clientpack/*.css
go-bindata -nomemcopy -nometadata -prefix clientpack clientpack
$(BINNAME).exe: bindata.go *.go

View File

@ -4,7 +4,7 @@
"description": "",
"main": "s",
"scripts": {
"build": "webpack && cp client/index.htm clientpack"
"webpack": "webpack"
},
"repository": {
"type": "git",