-
-
Notifications
You must be signed in to change notification settings - Fork 611
Closed
Description
- Rollup Plugin Name:
@rollup/plugin-commonjs - Rollup Plugin Version: 17.0.0
- Rollup Version: 2.36.1
- Operating System (or Browser): MacOS BigSur
- Node Version: v14.13.1
- Link to reproduction (
⚠️ read below): replit github
Expected Behavior
Plugin should correctly handle shorthand properties with require in them.
Actual Behavior
It seems to replace it with helper which brakes the parsing.
Additional Information
This originally popped up for me when using vm2. It would try to replace shorthand require with commonjsHelpers.commonjsRequire which would give error like the one below, when babel would try to transpile it.
1242 | const HOST = {
1243 | version: parseInt(process.versions.node.split('.')[0]),
> 1244 | commonjsHelpers.commonjsRequire,
| ^
1245 | process,
1246 | console,
1247 | setTimeout,