@lightspeed/config-next

0.6.4 • Public • Published

@lightspeed/config-next

npm version

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

  1. Install the dependency in your webapp.
yarn add next @lightspeed/config-next
  1. Consume the Next.js plugin.
// next.config.js
const withLightspeed = require('@lightspeed/config-next');
module.exports = withLightspeed();
  1. Consume the Babel preset.
// babel.config.js
module.exports = {
  presets: ['@lightspeed/config-next/babel-preset-next'],
};
  1. 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'],
            },
          },
        },
      },
    ],
  ],
};

/@lightspeed/config-next/

    Package Sidebar

    Install

    npm i @lightspeed/config-next

    Weekly Downloads

    67

    Version

    0.6.4

    License

    MIT

    Unpacked Size

    13.3 kB

    Total Files

    15

    Last publish

    Collaborators

    • kurt.bergeron
    • lightspeedhq
    • ls-guillaume-lambert
    • ls-frederic-bouchard
    • anomen