Moh*_*med 8 vue.js vuejs2 pinia
在我的 Vue 2 项目上安装 Pinia 并将其导入到 main.js 文件中后,我收到此错误
Failed to compile.
./node_modules/pinia/dist/pinia.mjs 1147:44-52
Can't import the named export 'computed' from non EcmaScript module (only default export is available)
Run Code Online (Sandbox Code Playgroud)
这个 Vue 配置应该可以解决问题
// vue.config.js
module.exports = {
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
}
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
正如本Github 问题中提到的。
归档时间: |
|
查看次数: |
5405 次 |
最近记录: |