You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[vite]: Rollup failed to resolve import "element-plus/es/el-color-picker" from "G:/WebstormProjects/test-formily/src/components/formily/color-picker/index.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`
error during build:
Error: [vite]: Rollup failed to resolve import "element-plus/es/el-color-picker" from "G:/WebstormProjects/test-formily/src/components/formily/color-picker/index.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:///G:/WebstormProjects/test-formily/node_modules/.pnpm/registry.npmmirror.com+vite@4.2.1_hghbulspu73jfdazs4i6yiqype/node_modules/vite/dist/node/chunks/dep-79892de8.js:46368:19)
at onwarn (file:///G:/WebstormProjects/test-formily/node_modules/.pnpm/registry.npmmirror.com+vite@4.2.1_hghbulspu73jfdazs4i6yiqype/node_modules/vite/dist/node/chunks/dep-79892de8.js:46138:13)
at Object.onwarn (file:///G:/WebstormProjects/test-formily/node_modules/.pnpm/registry.npmmirror.com+rollup@3.20.2/node_modules/rollup/dist/es/shared/node-entry.js:25149:13)
at ModuleLoader.handleInvalidResolvedId (file:///G:/WebstormProjects/test-formily/node_modules/.pnpm/registry.npmmirror.com+rollup@3.20.2/node_modules/rollup/dist/es/shared/node-entry.js:23784:26) at file:///G:/WebstormProjects/test-formily/node_modules/.pnpm/registry.npmmirror.com+rollup@3.20.2/node_modules/rollup/dist/es/shared/node-entry.js:23744:26
at processTicksAndRejections (node:internal/process/task_queues:96:5)
ELIFECYCLE Command failed with exit code 1.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
参照formily/element-plus的源代码, 自定义了一个 color-picker, 在开发模式下能正常显示, 但打包就报错, 错误内容如下
用全量引入的模式, 打包和运行都能正常, 应该是按需引入 element-plus 的问题, 请问应该如何解决?
codesandbox地址
Beta Was this translation helpful? Give feedback.
All reactions