I always used require call inside webpack.config.js to import libraries for my build workflow. However, recently I worked on a project where import is used.
Generally, it works fine but seems like some supporting tools that import webpack.config.js cannot import it when import is used inside of it with error:
Cannot use
importstatement outside a module.
As a tryout, I changed the config to run through babel and it worked, though for me looks like I am fine to use just good old require and official documentation still uses it.
Should I rollback import to avoid the caveats or I can use them without problem if I pass it through babel and renaming to webpack.config.babel.js?