Closed hisusqristos closed 1 year ago
tho i struggle with choosing modules. is commonJS ok?
CommonJS might be ok, but struggle is not.
There was a long evolution of how we put JS in web page to work.
Evan You, creator of Vue.js and many other things, gave a nice presentation of the history, arriving why they built Vite for front-end tooling.
Watch here https://www.youtube.com/watch?v=Znd11rVHQOE&t=985s
P.S. you might not need to use Vite, it's still interesting quick recap of last 10-20 years of using JS in browsers.
TL;DR:
Im changing outfile to outDir to use comfortable modulessetting outFile in tsconfig.json was an experimental thing to do. outFile works with limited modules (
None
,System
,Amd
). Here we useNone
which means there is no import/export/require methods to grab variables from vneshni mir. you can reference those variables and vsyo, no red underlines. But the ordering is messed up. you define variablex
in fileAAA.ts
then try to use it inindex.ts
and getBlock-scoped variable 'x' used before its declaration.
haskacaq? petqa mi hat el dnes hertakanutyuny mtaces .