Open oovm opened 4 years ago
I believe the issue is that vuepress uses webpack 4, which does not recognize the import.meta
syntax (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta).
I had a similar error message and solved it by installing the @open-wc/webpack-import-meta-loader
package (https://github.com/open-wc/open-wc/tree/master/packages/webpack-import-meta-loader) as a dev dependency. After that, vuepress needs to be told to use that loader. Make the following changes in your vuepress config:
configureWebpack: {
module: {
rules: [
{
test: /\.js$/,
loader: require.resolve('@open-wc/webpack-import-meta-loader')
}
]
}
}
Hope this helps!
And if anyone knows a better way to achieve this, I'm definitely interested.
Bug report
Unable to recognize the loader even if
chainWebpack
has been set.Steps to reproduce
The following is the minimum reproduction:
What is expected?
What is actually happening?
Other relevant information
npx vuepress info
in my VuePress project: