当我尝试quasar dev
:
[ERROR] [plugin vite: deep -pre-bundle]解析包"fs"条目失败。包可能在其包中指定了不正确的main/module/exports。解析包"fs"条目失败。package.json中可能有不正确的main/module/exports。
在网上,我发现了这个链接的解决方案:
类星体vite的解决方案是在quasar.config.js中添加这部分
extendViteConf(viteConf, { isServer, isClient }) {
// do something with viteConf... change it in-place
viteConf.resolve = {
alias: {
...viteConf.resolve.alias, // that's important we want to keep the alias set by quasar team
fs: require.resolve('rollup-plugin-node-builtins'),
child_process: require.resolve('rollup-plugin-node-builtins'),
},
};
},
为您省去数小时搜索的麻烦。