@ranger-theme/nextjs-config
v0.13.0
Published
## ๐ Introduce
Downloads
72
Readme
@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