Replies: 1 comment 1 reply
-
A little bit of internet sleuthing got me this tweet: https://twitter.com/hdjirdeh/status/1369709676271726599 npm i -D critters
Functionally it seems work :) but I would like more documentation on this + TailwindCSS
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to embed tailwind and global css within the head elements across SSR and static pages with the following custom
_document.tsx
:This works locally with
next.js
withnpm run build
andnpm run serve
, but does not work when the project is deployed onto vercel.The issue is a disparity of where the
static/css
files are located between local and on vercel..next/static/css
for both SSR and pre-rendered pages._next/static/css
for SSR pages and found at.next/static/css
for pre-rendered pages (like404
which doesn't requiregetInitialProps
).The result on vercel is using
path.join('.next', file)
will allow for the project to be successfully built, but fail on a request for a SSR page (because it's no longer.next
but_next
). And usingpath.join('_next', file)
causes the build to fail, because for pre-rendered pages done on the server, the_next
directory isn't available created and copied over from.next/static
yet.Is there a way to configure vercel to serve
.next/static
under.next
instead of_next
?Beta Was this translation helpful? Give feedback.
All reactions