ubiquibot / permit-generation

A standalone module to generate permits.
0 stars 6 forks source link

chore: changed esm to cjs #14

Closed gentlementlegen closed 2 months ago

gentlementlegen commented 2 months ago

Simply changed esm to cjs because we mostly use cjs in all our projects, and removed preserveModules to lighten the generated code.

gentlementlegen commented 2 months ago

@gitcoindev Maybe let me try to fix the dist output in this PR, will have a look at what you linked and try to implement the same with rollup

Refers to discussion: https://github.com/ubiquibot/permit-generation/pull/13#issuecomment-2060380353

gitcoindev commented 2 months ago

@gitcoindev Maybe let me try to fix the dist output in this PR, will have a look at what you linked and try to implement the same with rollup

Refers to discussion: #13 (comment)

sure, good luck!

gentlementlegen commented 2 months ago

@gitcoindev So it should be solved by giving the paths inside the package.json file. However to make it work when imported, other projects should set "moduleResolution": "Node16" inside the tsconfig.json to properly resolve the paths.

gitcoindev commented 2 months ago

@gitcoindev So it should be solved by giving the paths inside the package.json file. However to make it work when imported, other projects should set "moduleResolution": "Node16" inside the tsconfig.json to properly resolve the paths.

We should put this info in the readme somewhere. I found out at https://www.typescriptlang.org/tsconfig#moduleResolution that nodenext should also work, and possibly bundler as well.

gentlementlegen commented 2 months ago

@gitcoindev Correct these options should be viable as well. It is actually used in https://github.com/ubiquity/pay.ubq.fi/pull/224/files#diff-b55cdbef4907b7045f32cc5360d48d262cca5f94062e353089f189f4460039e0L28