Added TypeScript compilation stuff.

This commit is contained in:
flash 2018-11-05 17:45:22 +01:00
parent 02126c6dd6
commit 90d325966d
3 changed files with 18 additions and 2 deletions

View file

@ -120,6 +120,9 @@ function recursiveCopy(string $source, string $dest): bool
return true;
}
// Make sure we're running from the misuzu root directory.
chdir(__DIR__);
misuzu_log('Cleanup');
createDirIfNotExist(CSS_DIR);
createDirIfNotExist(JS_DIR);
@ -137,8 +140,9 @@ if (!is_file(LESS_DIR . LESS_ENTRY_POINT)) {
}
// figure this out
//misuzu_log();
//misuzu_log('Compiling TypeScript');
misuzu_log();
misuzu_log('Compiling TypeScript');
misuzu_log(shell_exec('tsc --extendedDiagnostics -p tsconfig.json'));
misuzu_log();
misuzu_log('Importing libraries');

View file

@ -79,5 +79,6 @@
elem.classList.add(containerHiddenClass);
}
</script>
<script src="/js/misuzu.js"></script>
</body>
</html>

11
tsconfig.json Normal file
View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ES5",
"removeComments": true,
"preserveConstEnums": true,
"outFile": "./public/js/misuzu.js",
"sourceRoot": "./assets/typescript/",
"rootDir": "./assets/typescript/",
"sourceMap": true,
}
}