@juliankrieger/chat-app-typings v2.1.0
Typings for https://gitlab.com/wehrloserstock/chat-app
How I got this to work: Step 1: Create a folder named "src"
Step 2: Add "index.ts" to "src"
Step 3: Define all typings in a folder "src/typings"
Step 4: Export those in a namespace, or none at all. Typescript modules
seem to be an old thing. They were local modules,
and namespaces were modules able to be exported to global namespace. Just use namespace
.
Step 5: Re-export those in ìndex.ts
Step 6: For this to work with BOTH NodeJS, which uses CommonJS as it's module system, AND React, which uses
ES6 Style import and export, tell tsc in tsconfig.json
that the module system should be CommonJS
, and compile
for target ES5
. IMPORTANT: The "not-NodeJS" environment NEEDS both the flags "allowSyntheticDefaultImports": true
and esModuleInterop.
Step 6: Tell NPM to build the files and put them into a dist folder
Step 7: Tell NPM that the types are in dist/index.d.ts
and the main file is dist/index.js
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago