报错信息:error during build:
Error: [vite]: Rollup failed to resolve import "D:/www/data-pool/node_modules/@arco-design/web-vue/es/dsubmenu/style/css.js" from "src/views/...?vue&type=script&setup=true&lang.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
at onRollupWarning (file:///D:/www/data-pool/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:45832:19)
at onwarn (file:///D:/www/data-pool/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:45603:13)
at Object.onwarn (file:///D:/www/data-pool/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:23263:13)
at ModuleLoader.handleResolveId (file:///D:/www/data-pool/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22158:26)
at file:///D:/www/data-pool/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22119:26
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
基本信息
额外补充
报错信息:error during build: Error: [vite]: Rollup failed to resolve import "D:/www/data-pool/node_modules/@arco-design/web-vue/es/dsubmenu/style/css.js" from "src/views/...?vue&type=script&setup=true&lang.ts". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to
build.rollupOptions.external
at onRollupWarning (file:///D:/www/data-pool/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:45832:19) at onwarn (file:///D:/www/data-pool/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:45603:13) at Object.onwarn (file:///D:/www/data-pool/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:23263:13) at ModuleLoader.handleResolveId (file:///D:/www/data-pool/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22158:26) at file:///D:/www/data-pool/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22119:26 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.预期结果
/config/plugin/styleImport.ts
中加入dsubmenu
忽略复现步骤
只要使用了多级下拉菜单,打包就报错