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

Why do we need postbuild.sh? #121

Closed
po4tion opened this issue Jul 3, 2024 · 4 comments
Closed

Why do we need postbuild.sh? #121

po4tion opened this issue Jul 3, 2024 · 4 comments
Assignees

Comments

@po4tion
Copy link
Contributor

po4tion commented Jul 3, 2024

I have a question. Why do we need this file(.scripts/postbuild.sh)?

Originally posted by @po4tion in #16 (comment)

@po4tion po4tion changed the title Hello @raon0211 ! Why we need postbuild.sh? Jul 3, 2024
@po4tion po4tion changed the title Why we need postbuild.sh? Why do we need postbuild.sh? Jul 3, 2024
@manudeli
Copy link
Member

manudeli commented Jul 3, 2024

👀 (I'm curious about this too)

@raon0211
Copy link
Collaborator

raon0211 commented Jul 5, 2024

Without this, TypeScript cannot resolve the types correctly when we use "moduleResolution": "Node10", the default resolution method. This happens because it does not respect the exports field.

You can verify this with Are the types wrong?.

@manudeli
Copy link
Member

manudeli commented Jul 5, 2024

@raon0211 When I remove postbuild.sh, I could see below error(Resolution failed). I understood it

image

@po4tion You can test like below

  1. remove ./.scripts/postbuild.sh in build script of package.json
    - "build": "tsup && ./.scripts/postbuild.sh",
    + "build": "tsup",
  2. yarn pack to make package.tgz
  3. put package.tgz in file input of Are the types wrong?
  4. You can see this error

@raon0211 raon0211 closed this as completed Jul 5, 2024
@po4tion
Copy link
Contributor Author

po4tion commented Jul 6, 2024

Thanks to you, I solved my curiosity

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

3 participants