💻
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-27
WARNING 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!
💻
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:
I think this is due to
commonjsRequire's use ofrequire(path).Environment
Tested in a fresh
create-react-appenvironment, 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!