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

optimize publish related settings #10

Closed
LoTwT opened this issue Aug 4, 2023 · 0 comments
Closed

optimize publish related settings #10

LoTwT opened this issue Aug 4, 2023 · 0 comments

Comments

@LoTwT
Copy link
Contributor

LoTwT commented Aug 4, 2023

Situation

In #9, it fixes the playground import in a hacked way which adds the ./dist field of the exports in the package.json.

Alternative solution

I think adding a files field in the package.json is a better solution.

  • remove the ./dist of the publish() in the .build.mjs
  • add files in the package.json
    {
      "files": ["dist"]
    }
  • update related fields in the package.json such as exports, main, module, and types
  • pnpm build and can also run npm pack --dry-run to see the tarball contents if need
  • change the import statements in the playground

After doing the above, I think the imports and exports are unified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants