rsnext/packages/next/lib/import-next-warning.ts
JJ Kasper b1a7b88890
Add warning when importing "next" directly (#35884)
* Add warning when importing "next" directly

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* add example

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Steven <steven@ceriously.com>
2022-04-05 10:57:45 -05:00

5 lines
205 B
TypeScript

import * as Log from '../build/output/log'
Log.warn(
`"next" should not be imported directly, imported in ${module.parent?.filename}\nSee more info here: https://nextjs.org/docs/messages/import-next`
)