@ranger-theme/nextjs-config

0.13.0ย โ€ขย Publicย โ€ขย Published

@ranger-theme/nextjs-config

๐ŸŽ‰ Introduce

nextjs้…็ฝฎ

๐Ÿ“š Documentation

๐Ÿ“ฆ Install

$ npm install --save-dev @ranger-theme/nextjs-config
# or
$ yarn add --save-dev @ranger-theme/nextjs-config
# or
$ pnpm add --save-dev @ranger-theme/nextjs-config

๐Ÿ”จ Usage

const nextConfig = require('@ranger-theme/nextjs-config')

const pkg = require('./package.json')

const isProd = process.env.NODE_ENV === 'production'

/** @type {import('next').NextConfig} */
module.exports = nextConfig({
  pkg,
  timestamp: new Date().getTime(),
  transpilePackages: [],
  compiler: {
    reactRemoveProperties: isProd,
    removeConsole: false,
    emotion: {
      sourceMap: !isProd,
      autoLabel: 'dev-only',
      labelFormat: '[local]',
      importMap: {
        '@mui/system': {
          styled: {
            canonicalImport: ['@emotion/styled', 'default'],
            styledBaseImport: ['@mui/system', 'styled']
          }
        },
        '@mui/material/styles': {
          styled: {
            canonicalImport: ['@emotion/styled', 'default'],
            styledBaseImport: ['@mui/material/styles', 'styled']
          }
        }
      }
    }
  },
  plugins: []
})

SVG Builder

  • generate svg builder config file: next.svg.js
module.exports = {
  dir: 'svgs',
  output: 'components',
  componentName: 'SvgResource',
  extension: 'ts'
}
  • use commond to generate svg components: pnpm svgbuilder
pnpm svgbuilder

Readme

Keywords

none

Package Sidebar

Install

npm i @ranger-theme/nextjs-config

Weekly Downloads

4

Version

0.13.0

License

MIT

Unpacked Size

18.8 kB

Total Files

9

Last publish

Collaborators

  • jdream