Download next.js/packages/next/src/build/babel/plugins/next-font-unsupported.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 955 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/build/babel/plugins/next-font-unsupported.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/build/babel/plugins/next-font-unsupported.ts
-
curl -L -o next-font-unsupported.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/build/babel/plugins/next-font-unsupported.ts
955 Bytes
| import type { NodePath, types } from 'next/dist/compiled/babel/core' | |
| import type { PluginObj } from 'next/dist/compiled/babel/core' | |
| export default function NextPageDisallowReExportAllExports(): PluginObj<any> { | |
| return { | |
| visitor: { | |
| ImportDeclaration(path: NodePath<types.ImportDeclaration>) { | |
| if ( | |
| [ | |
| '@next/font/local', | |
| '@next/font/google', | |
| 'next/font/local', | |
| 'next/font/google', | |
| ].includes(path.node.source.value) | |
| ) { | |
| const err = new SyntaxError( | |
| `"next/font" requires SWC although Babel is being used due to a custom babel config being present.\nRead more: https://nextjs.org/docs/messages/babel-font-loader-conflict` | |
| ) | |
| ;(err as any).code = 'BABEL_PARSE_ERROR' | |
| ;(err as any).loc = | |
| path.node.loc?.start ?? path.node.loc?.end ?? path.node.loc | |
| throw err | |
| } | |
| }, | |
| }, | |
| } | |
| } | |