diff --git a/package.json b/package.json index fef601a..27764ca 100644 --- a/package.json +++ b/package.json @@ -16,5 +16,8 @@ "devDependencies": { "tslint": "^6.1.3", "typescript": "^4.2.4" + }, + "dependencies": { + "sweetalert2": "^10.16.7" } } diff --git a/src/index.html b/src/index.html index 921dcb1..6bdad83 100644 --- a/src/index.html +++ b/src/index.html @@ -9,6 +9,10 @@

Basic setup for Typescript usage with normal HTML files

Open the console to see a console message written via typescript

+ +

You can also check whether external libraries are loaded (you need to be running this from a server)

+ + \ No newline at end of file diff --git a/src/scripts/library-check.ts b/src/scripts/library-check.ts new file mode 100644 index 0000000..3dd412c --- /dev/null +++ b/src/scripts/library-check.ts @@ -0,0 +1,7 @@ +import Swal from 'sweetalert2'; + +document.addEventListener('DOMContentLoaded', function () { + document.getElementById('library-check-button')?.addEventListener('click', function () { + Swal.fire('Library loaded successfully'); + }) +}) \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 879dec0..b0b81a0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + "module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ "lib": ["dom", "dom.iterable", "esnext"], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ @@ -43,7 +43,7 @@ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */