diff --git a/code/frameworks/nextjs/src/babel/plugins/next-font-unsupported.ts b/code/frameworks/nextjs/src/babel/plugins/next-font-unsupported.ts deleted file mode 100644 index 510e0b24c152..000000000000 --- a/code/frameworks/nextjs/src/babel/plugins/next-font-unsupported.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { NodePath, PluginObj, types } from '@babel/core'; - -/** - * Source: https://github.com/vercel/next.js/blob/canary/packages/next/src/build/babel/plugins/next-font-unsupported.ts - */ -export default function NextPageDisallowReExportAllExports(): PluginObj { - return { - visitor: { - ImportDeclaration(path: NodePath) { - if (['@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; - } - }, - }, - }; -} diff --git a/code/frameworks/nextjs/src/babel/plugins/next-page-disallow-re-export-all-exports.ts b/code/frameworks/nextjs/src/babel/plugins/next-page-disallow-re-export-all-exports.ts deleted file mode 100644 index 10a7b635eff2..000000000000 --- a/code/frameworks/nextjs/src/babel/plugins/next-page-disallow-re-export-all-exports.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Source: https://github.com/vercel/next.js/blob/canary/packages/next/src/build/babel/plugins/next-page-disallow-re-export-all-exports.ts - */ -import type { NodePath, PluginObj, types } from '@babel/core'; - -export default function NextPageDisallowReExportAllExports(): PluginObj { - return { - visitor: { - ExportAllDeclaration(path: NodePath) { - const err = new SyntaxError( - `Using \`export * from '...'\` in a page is disallowed. Please use \`export { default } from '...'\` instead.\n` + - `Read more: https://nextjs.org/docs/messages/export-all-in-page` - ); - (err as any).code = 'BABEL_PARSE_ERROR'; - (err as any).loc = path.node.loc?.start ?? path.node.loc?.end ?? path.node.loc; - throw err; - }, - }, - }; -}