#all variables became global

1 messages · Page 1 of 1 (latest)

cobalt stirrup
#

the title says it, check my tsconfig

{
  "$schema": "https://raw.githubusercontent.com/TypeScriptToLua/TypeScriptToLua/master/tsconfig-schema.json",
  "compilerOptions": {
    "target": "ESNext",
    "moduleResolution": "Bundler",
    "skipLibCheck": true,
    "strictNullChecks": true,
    "strict": true
  },
  "tstl": {
    "luaTarget": "5.4"
  },
  "exclude": ["node_modules"]
}

and the video

bitter trail
#

those are (probably) being detected as scripts, if you want then to be treated as modules use "module": "esnext" or one of the other es* values

#

normally for node you'd use nodenext/node16 but seems like you aren't using that

cobalt stirrup
#

setting "module": "ESNext" did not help

bitter trail
#

have you tried restarting the server?

cobalt stirrup
#

ofc

bitter trail
#

you might need export statements, i don't remember tbh..

#

real quick though, are you using modules?

cobalt stirrup
#

modules?

bitter trail
#

import/export

cobalt stirrup
#

yes sure

bitter trail
#

do both the files in that test have imports/exports

cobalt stirrup
#

oh I see what you mean, I added export {} to one of my files and variables stopped meing global

#

but can I not do it really?

bitter trail
#

they need to be analyzable as modules

paper tree
bitter trail
cobalt stirrup
#

I am not :]

bitter trail
#

how would you like.. actually use them as modules then

cobalt stirrup
#

{}

bitter trail
#

that's kinda the point of modularization

cobalt stirrup
#

@bitter trail thank you

#

@paper tree thank you