1
0
Fork 0

Removed tests from deployed build

This commit is contained in:
Michaël Lemaire 2018-03-08 22:48:33 +01:00
parent ce2b94fe83
commit e41cfa8299
4 changed files with 20 additions and 10 deletions

View File

@ -94,7 +94,6 @@ Common UI
Technical
---------
* Remove testing code from optimized build
* Fix alpha being altered in atlases
* Pack sounds
* Add toggles for shaders, automatically disable them if too slow, and initially disable them on mobile

View File

@ -33,9 +33,9 @@ function exec(command) {
/**
* Build app from typescript sources
*/
function ts() {
function ts(dist = false) {
console.log("Building app...");
return exec("tsc -p .");
return exec(`tsc -p ${dist ? "./tsconfig.dist.json" : "."}`);
}
/**
@ -160,9 +160,9 @@ function watch_vendors() {
/**
* Trigger a single build
*/
function build() {
function build(dist = false) {
return Promise.all([
ts(),
ts(dist),
data(),
vendors()
]);
@ -172,14 +172,15 @@ function build() {
* Optimize the build for production
*/
function optimize() {
return exec("uglifyjs out/build.js --source-map --output out/build.min.js");
// TODO do not overwrite dev build
return exec("uglifyjs out/build.dist.js --source-map --output out/build.js");
}
/**
* Deploy to production
*/
function deploy(task) {
return build().then(optimize).then(() => {
return build(true).then(optimize).then(() => {
return exec("rsync -avz --delete ./out/ hosting.thunderk.net:/srv/website/spacetac/")
});
}
@ -188,7 +189,7 @@ function deploy(task) {
* Run tests in karma, using freshly built app
*/
function test(task) {
return build().then(() => {
return ts().then(() => {
return exec("karma start spec/support/karma.conf.js");
}).then(() => {
return exec("remap-istanbul -i out/coverage/coverage.json -o out/coverage -t html");

10
tsconfig.dist.json Normal file
View File

@ -0,0 +1,10 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"out": "out/build.dist.js",
"removeComments": true
},
"exclude": [
"src/**/*.spec.ts"
]
}

View File

@ -4,7 +4,7 @@
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"removeComments": true,
"removeComments": false,
"preserveConstEnums": true,
"out": "out/build.js",
"strict": true,
@ -17,6 +17,6 @@
"target": "es5"
},
"include": [
"src"
"src/**/*.ts"
]
}