Initial boiler plate project
This commit is contained in:
27
node_modules/next/dist/esm/build/babel/plugins/commonjs.js
generated
vendored
Normal file
27
node_modules/next/dist/esm/build/babel/plugins/commonjs.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
import commonjsPlugin from "next/dist/compiled/babel/plugin-transform-modules-commonjs";
|
||||
// Handle module.exports in user code
|
||||
export default function CommonJSModulePlugin(...args) {
|
||||
const commonjs = commonjsPlugin(...args);
|
||||
return {
|
||||
visitor: {
|
||||
Program: {
|
||||
exit (path, state) {
|
||||
let foundModuleExports = false;
|
||||
path.traverse({
|
||||
MemberExpression (expressionPath) {
|
||||
if (expressionPath.node.object.name !== "module") return;
|
||||
if (expressionPath.node.property.name !== "exports") return;
|
||||
foundModuleExports = true;
|
||||
}
|
||||
});
|
||||
if (!foundModuleExports) {
|
||||
return;
|
||||
}
|
||||
commonjs.visitor.Program.exit.call(this, path, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=commonjs.js.map
|
||||
Reference in New Issue
Block a user