Skip to content

Commit

Permalink
fix: Remove automatic inclusion of Image
Browse files Browse the repository at this point in the history
Doing so adds `next/image` in the imports tree,
which is enough to automatically opt-in to Next.js
Image Optimization feature, which has drawbacks:
- Breaks static export
- Requires a server / serverless setup
- Requires setting up the Image Optimization config

Buying in the Image component should be explicit,
so imports will be separated.

See #187.
  • Loading branch information
franky47 committed Dec 11, 2020
1 parent b980457 commit e3a8b1b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ export * from './components/links'
export * from './components/redirect'
export * from './components/svg'
export * from './components/no-ssr'
export * from './components/image'
export * from './pages/_app'
export * from './ui/theme'
export * from './ui/colors'
export * from './ui/fonts'

// Note: Image is not exported, as doing so automatically opts-in
// the Next.js Image Optimization feature, which requires a server
// or an API to work, and breaks static exports, even if no Image
// component is used.
//
// To use the preview Chakra+Next Image component, import it as:
// import { Image } from '@47ng/chakra-next/dist/components/image

0 comments on commit e3a8b1b

Please sign in to comment.