Skip to content
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

Clean up format-title build process #10204

Merged
merged 1 commit into from Dec 2, 2021

Conversation

nickrum
Copy link
Member

@nickrum nickrum commented Dec 1, 2021

In addition to the cleanups, this also increases the target version to ES2019 for all builds except the global one, it changes unpkg's default entrypoint to the esm one to align with the sdk and it bundles the types to a single file resulting in a tiny two-line declaration file.

The build process and the way the exports in package.json work is inspired by vue-next.

The secondary goal of this PR is to find a build config that can also be applied to the SDK. (ref #10053, cc @joselcvarela)

@joselcvarela
Copy link
Member

Hey @nickrum
I don't know if you have tested this with some server side render framework but on #10053 I had trouble with .mjs file and Nuxt. I believe the cause is on VM module from Node.js
The solution was to remove the .mjs file and put export CJS file as default by setting main on package.json.

@nickrum
Copy link
Member Author

nickrum commented Dec 1, 2021

@joselcvarela I didn't test this PR with a server side render framework specifically, but I did test the SDK with SvelteKit when I added the index.mjs file, not having any troubles. Which version of Nuxt were you using? Re-exporting the cjs entrypoint from a *.mjs file is very common and also recommended by node to prevent dual package hazards.

That's weird, with a recent version of Node, the main field should just be ignored. This PR doesn't even change the main field, though.

@rijkvanzanten rijkvanzanten added this to the v9.1.3 milestone Dec 2, 2021
@rijkvanzanten rijkvanzanten merged commit 7e27071 into main Dec 2, 2021
@rijkvanzanten rijkvanzanten deleted the opt/format-title-build-cleanup branch December 2, 2021 16:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants