DreaMinder/nuxt-netlify-cache

[Suggestion] Use modern build flag

Closed this issue · 2 comments

I usually run nuxt build --modern to generate an additional bundle for modern browsers. I don't know if the added build time is worth the performance gains on the website, but since your module would also cache that bundle, a longer webpack build is not really an issue. 😉

I checked on nuxt.org, the modern flag also works with the new full static mode with nuxt build --modern && nuxt export

Adding --modern to this command https://github.com/DreaMinder/nuxt-netlify-cache/blob/master/bin/generate.js#L27 would do the trick?

I understand your concern, but It wouldn't be right to add this flag to advanced usage option, I'd have to handle all kinds of flags then (why stopping only on --modern?), it would complicate the code.
Why don't you use modern: process.env.NODE_ENV === 'production' in nuxt.config instead of a command flag?

Oh! I didn't know that it was possible to configure it from nuxt.config 😲 Thanks for the info!