Open sumanthratna opened 3 years ago
Just came from the linked Preact issue (sorry, was just taking a peek) but WMR does in fact come with prerendering right out of the box: https://github.com/preactjs/wmr/blob/91bc136e5c4a47c3ee3613e4d65183f4160ebe8e/packages/create-wmr/tpl/package.json#L2-L6
Linked is the pkg.json of the template that all new projects are created with. Prerendering is a flag but one we ship with.
Just came from the linked Preact issue (sorry, was just taking a peek) but WMR does in fact come with prerendering right out of the box: https://github.com/preactjs/wmr/blob/91bc136e5c4a47c3ee3613e4d65183f4160ebe8e/packages/create-wmr/tpl/package.json#L2-L6
Linked is the pkg.json of the template that all new projects are created with. Prerendering is a flag but one we ship with.
Thanks for taking a look @rschristian! :)
I read the npm README and it suggested using preact-iso instead of Preact.render so I assumed there was no out-of-the-box way to pretender Preact apps with wmr. It might help others if the --prerender
flag is mentioned somewhere in the README. Thanks for letting me know though; I'll take another look at wmr.
@sumanthratna
Ah, yeah. If you look that section has the header "Manual Installation and Setup". If you initialize with our template it is "out of the box" but I can see what you mean, the prerender functionality technically doesn't come with WMR itself.
I guess it's a bit of a different setup, but preact-iso
was basically created to be a set of tools for WMR: prerendering, lazy loading, router, etc. WMR itself has the flag to prerender but the functionality does come from elsewhere.
will save us many kb
I considered using vite or wmr but ~neither supports prerendering out of the box~ so I went with preact-cli
closes https://github.com/HackTJ/2021/issues/9
TODO:
src/template.html
with oldpublic/index.html
)switch
scripttint
scriptnodeLinker: node-modules
which installs tonode_modules/
), see https://github.com/preactjs/preact-cli/pull/1418class
/className