-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Description
I'm just trying to move my static html workflow away from Ruby based tools like Middleman to NodeJS based tools like Gatsby and I am having trouble trying to work out if there is a way to:
- Compile React modules to static html files (supported by gatsby using the
noProductionJavascriptoption) - Allow some JavaScript to still make it through the compile pipeline but still end up with a non-react dependent static html output overall.
Use case being that I occasionally do a pretty basic design to HTML conversion job for ad agencies so they expect me to deliver:
- Static
.htmlfiles for each "template" they had designed - Within their templates if anything requires JavaScript (modals, overlays, etc), those bits be supported and shipped as part of a JS bundle for the static app.
- Static assets (fonts, images, etc) be compressed
- Static output has usable
hrefs that they can click through to navigate the templates - The compiled HTML source should be neatly formatted and uncompressed
I believe Gatsby natively supports 1, 3 and 4. Point 5 is probably doable too but I am struggling to understand if 2 is possible as the noProductionJavascript seems to strip all JS out so I am not sure if I could for example have a file that is still being bundled containing custom app JS but not any of the react stuff.
Would be great to hear if this use case is supported somehow already or if I am perhaps looking at the wrong too for what I need to do :)