@lightspeed/config-next
v0.6.4
Published
Common Next.js configuration and plugins for Lightspeed apps
Downloads
533
Keywords
Readme
@lightspeed/config-next
Introduction
Next.js configuration and plugins in a convenient package.
Requirements
- Please ensure you are using
next@9
or higher
Features
- ✨ Enables TypeScript in your Next.js app
- 🔥 Configures HMR polling to run dev mode in Docker
- ➡ Absolute path resolving for root
src
:
// From anywhere in your app, this will resolve to `<root>/src/components/MyComponent.(js,ts,jsx,tsx)
import { MyComponent } from 'src/components/MyComponent';
Quick Start
- Install the dependency in your webapp.
yarn add next @lightspeed/config-next
- Consume the Next.js plugin.
// next.config.js
const withLightspeed = require('@lightspeed/config-next');
module.exports = withLightspeed();
- Consume the Babel preset.
// babel.config.js
module.exports = {
presets: ['@lightspeed/config-next/babel-preset-next'],
};
- Optionally, extend the configuration as you see fit.
// babel.config.js
module.exports = {
presets: [
[
'@lightspeed/config-next/babel-preset-next',
{
'next-babel': {
'preset-env': {
targets: {
browsers: ['not ie'],
},
},
},
},
],
],
};