From 90d325966dc9de1b358b340f8863c05c1b07408a Mon Sep 17 00:00:00 2001 From: flashwave Date: Mon, 5 Nov 2018 17:45:22 +0100 Subject: [PATCH] Added TypeScript compilation stuff. --- build.php | 8 ++++++-- templates/master.twig | 1 + tsconfig.json | 11 +++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tsconfig.json diff --git a/build.php b/build.php index a6ef22a1..a37fd0cf 100644 --- a/build.php +++ b/build.php @@ -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'); diff --git a/templates/master.twig b/templates/master.twig index 0f4fb276..c707cdf7 100644 --- a/templates/master.twig +++ b/templates/master.twig @@ -79,5 +79,6 @@ elem.classList.add(containerHiddenClass); } + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..eaba29fc --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "ES5", + "removeComments": true, + "preserveConstEnums": true, + "outFile": "./public/js/misuzu.js", + "sourceRoot": "./assets/typescript/", + "rootDir": "./assets/typescript/", + "sourceMap": true, + } +}