The babel implementation currently requires both babel-plugin-codegen & babel-plugin-preval leading to a verbose 2-line format:
const filename = preval`module.exports = __filename`;
const Layout = codegen.require("@ceteio/next-layout-loader", filename);
Is there a way to remove the need for preval?
When I try to add __filename directly as the second parameter to codegen.require, I get an error:
const Layout = codegen.require("@ceteio/next-layout-loader", __filename);
Error: codegen cannot determine the value of an argument in codegen.require
at Array.map (<anonymous>)
The babel implementation currently requires both
babel-plugin-codegen&babel-plugin-prevalleading to a verbose 2-line format:Is there a way to remove the need for
preval?When I try to add
__filenamedirectly as the second parameter tocodegen.require, I get an error: