Run npm start
to
- watch TS files
- start server on
localhost:9000
Entry point is currently /dist/index.js
(compiled from /src/index.ts
).
PROBLEM:
index.html
is served correctly, and is loadingdist/index.js
without problem.- HOWEVER โ line 5 of
dist/index.js
is causing this error:
Uncaught ReferenceError: exports is not defined
- According to this Stackoverflow link the error is caused by the fact that TypeScript compiles down to JavaScript modules, though most browsers don't support modules at this time.
- TO FIX โ "You will need to use some tool (webpack, rollup, browserify) to bundle your modules after compilation". Boooo. But OK. This is the next step: getting webpack to play nicely with TS.