vite.config.ts引入unplugin-auto-import插件,编译后报错
- 发布:2022-06-10 18:38
- 更新:2022-06-12 12:01
- 阅读:481
产品分类: HbuilderX
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: MacOS12.4
HBuilderX版本号: 3.4.14
操作步骤:
预期结果:
编译成功
编译成功
实际结果:
18:33:03.391 项目 'city_mapping_mini_app' 开始编译...
18:33:04.028 请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。若要正式发布,请点击发行菜单或使用 cli 发布命令进行发布
18:33:04.034 正在编译中...
18:33:04.580 failed to load config from /Users/zero/Documents/swhl/repository/city_mapping_mini_app/vite.config.ts
18:33:04.585 error during build:
18:33:04.585 /Users/zero/Documents/swhl/repository/city_mapping_mini_app/node_modules/unimport/dist/chunks/vue-template.cjs:55
18:33:04.591 const name = i.as ?? i.name;
18:33:04.593 ^
18:33:04.594 SyntaxError: Unexpected token '?'
18:33:04.594 at wrapSafe (internal/modules/cjs/loader.js:915:16)
18:33:04.597 at Module._compile (internal/modules/cjs/loader.js:963:27)
18:33:04.597 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
18:33:04.599 at Module.load (internal/modules/cjs/loader.js:863:32)
18:33:04.601 at Function.Module._load (internal/modules/cjs/loader.js:708:14)
18:33:04.601 at Module.require (internal/modules/cjs/loader.js:887:19)
18:33:04.602 at require (internal/modules/cjs/helpers.js:74:18)
18:33:04.603 at Object.<anonymous> (/Users/zero/Documents/swhl/repository/city_mapping_mini_app/node_modules/unimport/dist/addons.cjs:5:21)
18:33:04.605 at Module._compile (internal/modules/cjs/loader.js:999:30)
18:33:04.606 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
18:33:03.391 项目 'city_mapping_mini_app' 开始编译...
18:33:04.028 请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。若要正式发布,请点击发行菜单或使用 cli 发布命令进行发布
18:33:04.034 正在编译中...
18:33:04.580 failed to load config from /Users/zero/Documents/swhl/repository/city_mapping_mini_app/vite.config.ts
18:33:04.585 error during build:
18:33:04.585 /Users/zero/Documents/swhl/repository/city_mapping_mini_app/node_modules/unimport/dist/chunks/vue-template.cjs:55
18:33:04.591 const name = i.as ?? i.name;
18:33:04.593 ^
18:33:04.594 SyntaxError: Unexpected token '?'
18:33:04.594 at wrapSafe (internal/modules/cjs/loader.js:915:16)
18:33:04.597 at Module._compile (internal/modules/cjs/loader.js:963:27)
18:33:04.597 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
18:33:04.599 at Module.load (internal/modules/cjs/loader.js:863:32)
18:33:04.601 at Function.Module._load (internal/modules/cjs/loader.js:708:14)
18:33:04.601 at Module.require (internal/modules/cjs/loader.js:887:19)
18:33:04.602 at require (internal/modules/cjs/helpers.js:74:18)
18:33:04.603 at Object.<anonymous> (/Users/zero/Documents/swhl/repository/city_mapping_mini_app/node_modules/unimport/dist/addons.cjs:5:21)
18:33:04.605 at Module._compile (internal/modules/cjs/loader.js:999:30)
18:33:04.606 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)