-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to esm #157
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As I implemented #117 I ran into some issues w/ esm. I attempted to migrate the project, but failed. I suspect it may have partially been mis-configuring. At any rate, here's a quick summary of what I learned...
For tsconfig:
target
: this just controls things like polyfills, i.e. "if I use fancy syntax, its valid / browser will provide it"module
: Whether to emit as commonjs or esm (+ a ilttle more nuance). What THIS app will be.esModuleInterop
: Helpers to handle imports that may be one or the other. What the DEPENDENCIES are.moduleResolution
: Yup, I've already forgottenFurther once compiled (typescript), and bundled (esbuild), there's an additional factor of Node (or the browser) being able to run the thing; the file extensions must be
.mjs
for the prebuild script (I think); package.json havingtype: "module"
tells the node process to run as esm.ANYWAYS, lots of moving parts. I may have to upgrade some of my dependencies; because of that I think it makes more sense to knock out the gonna-happy-anyway-dependency changes, likely as part of:
The text was updated successfully, but these errors were encountered: