My highly opinionated batteries included plugin-bundles
- Babel presets for next
@neat-preset/babel/next
and node@neat-preset/babel/node
- Production ready next configuration at
@neat-preset/next
which is including,next-images
andnext-fonts
- Adds dotenv loading behaviour similar to
create-react-app
- Adds global dev-expression (compiling
__DEV__
totrue
orfalse
based on yourNODE_ENV
on build-time) - Includes my favorite babel plugins like
babel-plugin-macros
and export-syntax extensions See list below
yarn add @neat-preset/next yarn add --dev @neat-preset/next-dev @neat-preset/babel
{
"presets": [
["@neat-preset/babel/next", {
"preset-env": {},
"transform-runtime": {},
"module-resolver": {},
"styled-jsx": {},
"class-properties": {}
"styled-components": {}
}]
],
"plugins": []
}
{
"presets": [
["@neat-preset/babel/node", {
"preset-env": {},
"transform-runtime": {},
"module-resolver": {},
"class-properties": {}
}]
],
"plugins": []
}
With images from a different host and inlined images by size limit:
module.exports = require('@neat-preset/next-dev')({
images: {
assetPrefix: 'https://images.example.com',
inlineImageLimit: 16384, // default is 8192
},
})({
target: 'serverless',
})
With fonts from a different remote or include SVG fonts:
module.exports = require('@neat-preset/next-dev')({
fonts: {
assetPrefix: 'https://fonts.example.com',
enableSvg: true,
},
})({
target: 'serverless',
})
List node_modules/
that should be transpiled before being included by webpack
module.exports = require('@neat-preset/next-dev')({
transpileModules: ['somemodule', 'and-another'],
})({
target: 'serverless',
})
Licensed under the MIT License, Copyright © 2019-present Richard Keil
See LICENSE for more information.
This project is standing on the shoulders of giants as it is build on top of earlier open-source work by clever folks all around the world.
Please check them out: