Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

Next.js example does not support AMP or SSG #96

Open
amerzad opened this issue Oct 2, 2020 · 4 comments
Open

Next.js example does not support AMP or SSG #96

amerzad opened this issue Oct 2, 2020 · 4 comments

Comments

@amerzad
Copy link

amerzad commented Oct 2, 2020

I think including the main css in _app.js does not support AMP nor SSG.
Any other example which can work completely right with Next.js?

@benbender
Copy link

SSG is supported with global css. So no problem there. AMP on the other hand is a completely different story as it doesn't allow external CSS at all. See https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/style_pages/.

@amerzad
Copy link
Author

amerzad commented Dec 14, 2020

@benbender Do you mean that example can be used as it is for SSG?

Anyway, I was successful in using Tailwind with both SSG and AMP but with some low DX, but not with the same way done in the example.

@benbender
Copy link

The example in this repo is very outdated. As its using next 9.2 and SSG was introduced in 9.3 it can't be used as it is.

But tailwind and SSG have no direct reference or dependency on each other.
You are statically generating HTML with SSG - which may or may not contain a reference to a CSS-file which may or may not be generated by tailwind. This HTML is sent to your browser. Thats it.

For AMP: you may be able to generate AMP-pages with tailwind in it - But they most likely won't be valid AMP.

@amerzad
Copy link
Author

amerzad commented Dec 16, 2020

@benbender Thanks for your input.
For the Tailwind and AMP, I can confirm that you can pretty well do a valid AMP with Tailwind if you just used the base and the utilities and forgot about the components, which are not needed with AMP for most of the cases.

And I think you confirm that the example is outdated, so, what is the process to update it with something official from Next.js team? Isn't it enough what I did of filing this issue?

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

No branches or pull requests

2 participants