-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Programmatic API (babel.transform, babel.parse)
Input code
import '@babel/standalone';
Configuration file name
No response
Configuration
N/A
Current and expected behavior
Current behavior: When bundling a project with Webpack which includes code that imports '@babel/standalone', Webpack reports:
WARNING in ./node_modules/@babel/standalone/babel.js 308:11-32
Critical dependency: the request of a dependency is an expression
@ ./src/index.js 9:0-27WARNING in ./node_modules/@babel/standalone/babel.js 346:11-24
Critical dependency: the request of a dependency is an expression
@ ./src/index.js 9:0-27
I think this is due to commonjsRequire's use of require(path).
Environment
Tested in a fresh create-react-app environment, as well as a more minimal Webpack environment.
Possible solution
Given that @babel/standalone is intended for use in a browser environment, I wonder why it includes bare require() calls. Perhaps these parts could be excluded from this build?
Additional context
Please let me know if there's anything else I can do to help. Thanks a bunch!