Webpack via ES modules in Webpack
By default, ES modules don't work in Webpack. You need to enable them. To do this, in the package.json file, specify the "type" setting with the value "module":
{
"type" : "module"
}
In your working folder, create package.json and include ES modules in it.