diff --git a/sample/next-app/next.config.js b/sample/next-app/next.config.js index bf35f9066..d03fcb3fb 100644 --- a/sample/next-app/next.config.js +++ b/sample/next-app/next.config.js @@ -1,6 +1,10 @@ /** @type {import('next').NextConfig} */ const nextConfig = { experimental: { + // You may not need this, it's just to support moduleResolution: 'node16' + extensionAlias: { + '.js': ['.tsx', '.ts', '.jsx', '.js'], + }, turbo: { resolveAlias: { // Turbopack does not support standard ESM import paths yet @@ -18,14 +22,6 @@ const nextConfig = { * See https://github.com/vercel/next.js/pull/66817 */ swcMinify: false, - webpack: (config) => { - // You may not need this, it's just to support moduleResolution: 'node16' - config.resolve.extensionAlias = { - '.js': ['.js', '.ts', '.tsx'], - }; - - return config; - }, }; export default nextConfig; diff --git a/sample/next-pages/next.config.js b/sample/next-pages/next.config.js index 3d5bd9b6e..7fa7e66bc 100644 --- a/sample/next-pages/next.config.js +++ b/sample/next-pages/next.config.js @@ -5,6 +5,10 @@ const nextConfig = { * Critical: prevents "ESM packages (pdfjs-dist/build/pdf.worker.min.mjs) need to be imported." error */ esmExternals: 'loose', + // You may not need this, it's just to support moduleResolution: 'node16' + extensionAlias: { + '.js': ['.tsx', '.ts', '.jsx', '.js'], + }, turbo: { resolveAlias: { // Turbopack does not support standard ESM import paths yet @@ -29,11 +33,6 @@ const nextConfig = { */ config.resolve.alias.canvas = false; - // You may not need this, it's just to support moduleResolution: 'node16' - config.resolve.extensionAlias = { - '.js': ['.js', '.ts', '.tsx'], - }; - return config; }, };