I’m writing a number of functions in Typescript, to be then compiled into JavaScript and used in Google-App-Script. They’re stored in separate files, with some imported into one another. I’d like the compiled JavaScript files to not have any of the import/export syntax because GAS does not need them (and will throw syntax errors) as GAS scripts have all functions and vars globally hoisted.
A usual file looks like this:
import { foo } from 'bar';
export function exampleFunction(input: string) {
foo(input);
}
I’d like my compiled javascript files to look like:
function exampleFunction(input: string) {
foo(input);
}
What tsconfig.json settings would allow the compilation as I’ve described? Or is this something I would need to write a script for, after compilation.
I tested the “module”: “none” settings, however that disallows all import/export statements inside of the Typescript code.