Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function NextToNextServer(...args: any): PluginObj {
const commonjs = commonjsPlugin(...args)
return {
visitor: {
Program: {
exit(path: NodePath, state) {
let foundModuleExports = false
path.traverse({
MemberExpression(path: any) {
if (path.node.object.name !== 'module') return
if (path.node.property.name !== 'exports') return
foundModuleExports = true
},
})
if (!foundModuleExports) {
return
}