From 7231fd79644bbf8ce358c06ba686443ac45cbb01 Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 18 Feb 2020 18:02:37 +0100 Subject: [PATCH] add release build. Use FPS Camera and better input. --- .vscode/launch.json | 15 +++++++++++++++ .vscode/tasks.json | 15 +++++++++++++++ index.html | 28 +++++++++++++++------------- package.json | 11 ++++++++--- 4 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..ff27aea --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name":"Launch index.html", + "type": "chrome", + "request": "launch", + "file": "${workspaceFolder}/index.html", + "preLaunchTask": "npm: build:debug" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..c681d1b --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "build", + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/index.html b/index.html index f3cd4c8..62b0eb1 100644 --- a/index.html +++ b/index.html @@ -84,7 +84,7 @@ vec3 color = vec3(n) * 0.3; gl_FragColor = vec4(color,1.0); } - + - - + style="margin:0 auto; border: solid #000000 1px; display:block; cursor:move;"> diff --git a/package.json b/package.json index 5d6954e..af63499 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,11 @@ "description": "Simulating a ocean with typescript and webgl.", "main": "index.html", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "build": "tsc && browserify ./build/main.js -o ./build/app.js" + "livedev": "concurrently --kill-others \"npm-watch\"", + "build:release": "tsc && browserify ./build/main.js | uglifyjs > ./build/app.js", + "build:debug": "tsc && browserify --debug ./build/main.js -o ./build/app.js", + "build:tsc": "tsc", + "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "webgl", @@ -20,7 +23,9 @@ "devDependencies": { "@types/gl-matrix": "^2.4.5", "browserify": "^16.5.0", - "typescript": "^3.7.5" + "concurrently": "^5.1.0", + "typescript": "^3.7.5", + "uglifyjs": "^2.4.11" }, "dependencies": { "gl-matrix": "^3.1.0"