diff --git a/packages/next/build/swc/options.js b/packages/next/build/swc/options.js index a39a686dccbf3..8ebbf96fce006 100644 --- a/packages/next/build/swc/options.js +++ b/packages/next/build/swc/options.js @@ -1,6 +1,8 @@ const nextDistPath = /(next[\\/]dist[\\/]shared[\\/]lib)|(next[\\/]dist[\\/]client)|(next[\\/]dist[\\/]pages)/ +const regeneratorRuntimePath = require.resolve('regenerator-runtime') + function getBaseSWCOptions({ filename, development, @@ -57,7 +59,7 @@ function getBaseSWCOptions({ }, }, regenerator: { - importPath: require.resolve('regenerator-runtime'), + importPath: regeneratorRuntimePath, }, }, },