Since NextJS log is no longer part of webpack logs, we cannot use FilterWarningsPlugin
. Instead, use node level stdout filter, for example, intercept-stdout
.
Category Archives: NextJS
NextJS: How to Exclude Packages from Bundle
Use browser
field in package.json
:
"browser": {
...
"package-name": false
}
How to Develop Emails with React: Running NextJS without Client JavaScript
Email development, oh thou necessary evils of the world.
Server side React (NextJS) would be helpful in constructing components and maintaining a united stack, but after the server render, no JavaScript or React is actually needed in the resulting HTML.
To completely disable client side JavaScript from document, do:
Continue readingHow to Mute Warnings of "Conflicting order between"
We use CSS modules, so it doesn’t make sense to care about importing order, but the mini-css-extract-plugin
doesn’t provide an option to turn off the conflicting warning:
chunk styles [mini-css-extract-plugin]
Conflicting order between:
* css ...
* css ...
Here’s how to mute them.
Continue readingWhen Webpack Takes Too Long to Process Images
Sorting out images in Webpack is not too bad up to a point. The url-loader
+ file-loader
combination is usually enough to satisfy needs. However, when you have too many require()
for large images, it can take up to 20s or longer to hot-reload after a compile…
Here’s how to mitigate the situation.
Continue readingHow to Configure Sub-Routes in NextJS
For sub-routes like guides/post-slug
to work, 3 pieces need to be in place: