Skip to content

Do imports used in getStaticProps get bundled? #18051

Answered by ljosberinn
mrclay asked this question in Help
Discussion options

You must be logged in to vote

Using typescript has no effect on this and as the docs mention, node code/code included in getStaticProps/getServerSideProps/getStaticPaths does not get bundled client side. You can easily confirm this e.g. if you enable browserSourceMaps: true in next.config.js > experimental and check the resulting source maps, which show any server side code greyed out.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@mrclay
Comment options

Answer selected by mrclay
Comment options

You must be logged in to vote
1 reply
@ljosberinn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants