Describe the bug
I can't register @babel/register with the following command
webpack --config-register @babel/register
What is the current behavior?
It returns following output
> webpack --config-register @babel/register "-w"
[webpack-cli] Unknown argument: --config-register
[webpack-cli] Unknown argument: @babel/register
? Which flags do you want to use? โฆ
โ --entry: The entry point(s) of your application e.g. ./src/main.js
โ --config: Provide path to a webpack configuration file e.g. ./webpack.config.js
โ --color: Enable/Disable colors on console
โ --merge: Merge two or more configurations using webpack-merge e.g. -c ./webpack.config.js -c ./webpack.test.config.js --merge
โ --progress: Print compilation progress during build
โ --help: Outputs list of supported flags
โ --output-path: Output location of the file generated by webpack e.g. ./dist/
โ --target: Sets the build target e.g. node
โ --watch: Watch for files changes
โ --hot: Enables Hot Module Replacement
โ --devtool: Determine source maps to use
โ --prefetch: Prefetch this request
โ --json: Prints result as JSON or store it in a file
โ --mode: Defines the mode to pass to webpack
โ --version: Get current version
โ --stats: It instructs webpack on how to treat the stats e.g. verbose
โ --env: Environment passed to the configuration when it is a function
โ --name: Name of the configuration. Used when loading multiple configurations.
โ --config-name: Name of the configuration to use
To Reproduce
Steps to reproduce the behavior:
"webpack --config-register @babel/register"Expected behavior
It should start executing webpack with no problem
Screenshots
Please paste the results of webpack-cli info here, and mention other relevant information
System:
OS: Linux 4.19 Ubuntu 20.04 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 1.31 GB / 4.82 GB
Binaries:
Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v12.18.1/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v12.18.1/bin/npm
Packages:
tsconfig-paths-webpack-plugin: ^3.3.0 => 3.3.0
webpack: ^5.0.0 => 5.0.0
webpack-cli: ^4.0.0 => 4.0.0
webpack-extension-reloader: ^1.1.4 => 1.1.4
webpack-watched-glob-entries-plugin: ^2.1.7 => 2.1.7
Additional context
@seahindeniz webpack-cli v4 doesn't support --config-register, you can see available options & commands here https://github.com/webpack/webpack-cli/tree/master/packages/webpack-cli#supported-arguments-and-commands
Hmm, thank you @snitin315
@snitin315 or @seahindeniz can you please say which parameter replaced --config-register.
Because i don't see any equivalent.
Hey @juwens
I use --config-register to register babel to be able to use ES6 stuff on the config file. After @snitin315's message, I simply switched from JS config file to TS.
Here, you can check my config from my repo
https://github.com/seahindeniz/BrainlyTools_Extension/blob/master/webpack.config.ts
https://github.com/seahindeniz/BrainlyTools_Extension/blob/master/package.json#L165
@juwens I believe it was removed without replacement.
Though if you find this is something that should be supported feel free to open a new issue about it with your use case.
Yes, we support ts/babel/etc files without extra options
Most helpful comment
@juwens I believe it was removed without replacement.
Though if you find this is something that should be supported feel free to open a new issue about it with your use case.