You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that cjs-module-lexer is battle-tested (it powers CommonJS in Node as of 14.17), we should switch to it. This gives us a clean way to support CJS-->ESM transformations like we're already doing, but without the horrible regex-based implementation I cobbled together.
inline my forked copy of cjs-module-lexer's JS version with require() tracking
create a new lib/transform-cjs.js module that wraps cjs-module-lexer (similar to lib/transform-imports.js)
replace fast-cjs-plugin.js implementation with a call to the new library
Now that cjs-module-lexer is battle-tested (it powers CommonJS in Node as of 14.17), we should switch to it. This gives us a clean way to support CJS-->ESM transformations like we're already doing, but without the horrible regex-based implementation I cobbled together.
cjs-module-lexer
's JS version withrequire()
trackinglib/transform-cjs.js
module that wrapscjs-module-lexer
(similar tolib/transform-imports.js
)(improved in Fix
require()()
in production bundle #156)The text was updated successfully, but these errors were encountered: