Comparar commits

...

Autor SHA1 Mensaje Fecha
  Adwaith Rao b12f0667b6 Non-working code for library setup check hace 4 años
Se han modificado 4 ficheros con 16 adiciones y 2 borrados
Dividir vista
  1. +3
    -0
      package.json
  2. +4
    -0
      src/index.html
  3. +7
    -0
      src/scripts/library-check.ts
  4. +2
    -2
      tsconfig.json

+ 3
- 0
package.json Ver fichero

@@ -16,5 +16,8 @@
"devDependencies": {
"tslint": "^6.1.3",
"typescript": "^4.2.4"
},
"dependencies": {
"sweetalert2": "^10.16.7"
}
}

+ 4
- 0
src/index.html Ver fichero

@@ -9,6 +9,10 @@
<body>
<h1>Basic setup for Typescript usage with normal HTML files</h1>
<p>Open the console to see a console message written via typescript</p>

<p>You can also check whether external libraries are loaded (you need to be running this from a server)</p>
<button id="library-check-button">Check SweetAlert2 is loaded</button>
<script src="./scripts/script.js"></script>
<script type="module" src="./scripts/library-check.js"></script>
</body>
</html>

+ 7
- 0
src/scripts/library-check.ts Ver fichero

@@ -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');
})
})

+ 2
- 2
tsconfig.json Ver fichero

@@ -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. */


Cargando…
Cancelar
Guardar