diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6136a9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +clientpack/** +node_modules/** \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..eab2057 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "0.1.0", + "command": "npm", + "isShellCommand": true, + "showOutput": "always", + "suppressTaskName": true, + "tasks": [ + { + "taskName": "install", + "args": ["install"] + }, + { + "taskName": "update", + "args": ["update"] + }, + { + "taskName": "test", + "args": ["run", "test"] + } + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index 3827c2c..1c71bd0 100644 --- a/Makefile +++ b/Makefile @@ -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 ' -e 'd}' \ - | sed -e '/dcwebui.js/{i ' -e 'd}' \ - | sed -e '/socket.io-1.7.2.js/{i ' -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 ' -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 diff --git a/client/dcwebui.js b/client/dcwebui.js index 810659c..c73bf9d 100644 --- a/client/dcwebui.js +++ b/client/dcwebui.js @@ -1,5 +1,8 @@ /* dcwebui.js */ + require("./dcwebui.css"); + require("./socket.io-1.7.2.js"); + "use strict"; var SENTINEL_PASSWORD = "************"; diff --git a/client/index.htm b/client/index.htm index bb3ae4f..9bf1e17 100644 --- a/client/index.htm +++ b/client/index.htm @@ -5,8 +5,7 @@ - - +