I was stuck trying to set-up two loaders: ‘babel-loader’ and ‘webpack-import-meta-loader’ for the same ‘js’ file in webpack.config.js
So I also looked at @babel/plugin-syntax-import-meta but installing it and adding the adequate line in for .babelrc was not enough.
I came back to the webpack.config.js and just added the two loaders one after another as in :
module: {
rules: [
{ test: /\.css$/, use: "css-loader" },
{
test: /\.js$/,
loader: require.resolve("@open-wc/webpack-import-meta-loader")
},
{
test: /.(js|jsx)$/,
include: [path.resolve(__dirname, "static/rdb/js/src")],
use: {
loader: "babel-loader"
}
}
]
}
And it works…
Thank you