Skip to content
Snippets Groups Projects
  • Alberto Gasparin's avatar
    cd00da76
    Convert commonjs to esm (#877) · cd00da76
    Alberto Gasparin authored
    This PR converts everything (aside from electron) from CommonJS to ESM.
    It is needed to reduce the changes that will happen during the migration
    to Typescript (as TS does not play nice with CJS).
    
    Basically:
    - rewrite `require()` to `import`
    - rewrite `module.exports` to `exports`
    - introduce `ts-node` to run importers so we can convert them to TS too
    
    Lastly, sorry for this larg-ish PR, not my preference but when I tried
    to reduce its scope, I would end up with mixed commons/esm that was even
    more tricky to handle.
    Convert commonjs to esm (#877)
    Alberto Gasparin authored
    This PR converts everything (aside from electron) from CommonJS to ESM.
    It is needed to reduce the changes that will happen during the migration
    to Typescript (as TS does not play nice with CJS).
    
    Basically:
    - rewrite `require()` to `import`
    - rewrite `module.exports` to `exports`
    - introduce `ts-node` to run importers so we can convert them to TS too
    
    Lastly, sorry for this larg-ish PR, not my preference but when I tried
    to reduce its scope, I would end up with mixed commons/esm that was even
    more tricky to handle.