Next.js configuration
Next.js configuration and resources
# Next recommendations are :
# - Set their config as the last to be extended in .eslintrc.json
# - Let their config assume options such as parser configuration etc ... details to be investigated if required
npm install --save-dev eslint-plugin-react eslint-plugin-react-hooks @next/eslint-plugin-next @mulekick/eslint-config-muleslint
# Despite Next recommendations, I favor global styles import over css modules
# However, this requires exporting an app wrapper component from pages/_app.js and manage global styles import there
npm install --save-dev sass
# Installing sharp (required for image optimization using next/image) from the start is a best practice imho
# It is mandatory for server-side image optimization if the app exports as a standalone bundle
# It will be resolved out of the dependency graph if the app exports as a static HTML website
npm install --save sharp
Next.js polyfills fetch()
on both the client and server. You don't need to import it.
- Supported options for styling are either global styling, css modules or direct styling of JSX components
- Sass is supported for css modules design through the use of the
*.module.scss
extension - It's good to note that css modules allow using the same CSS classes in different files without worrying about class name collisions ... This is because CSS modules automatically generate unique classes names.
- Also, the default built-in postcss config for Next.js seems to be rather decent