VITEでvue3.0プロジェクトをgithubpages用に書き出そうとしてエラー
vite v2.4.4 building for production...
✓ 17 modules transformed.
[vite]: Rollup failed to resolve import "assets/layout/images/logo-mobile.svg" from "src/pages/Error.vue".
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 "assets/layout/images/logo-mobile.svg" from "src/pages/Error.vue".
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 (/app/baixiangguo-client/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:51765:19)
at onwarn (/app/baixiangguo-client/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:51550:13)
at Object.onwarn (/app/baixiangguo-client/node_modules/rollup/dist/shared/rollup.js:20503:13)
at ModuleLoader.handleResolveId (/app/baixiangguo-client/node_modules/rollup/dist/shared/rollup.js:19852:26)
at /app/baixiangguo-client/node_modules/rollup/dist/shared/rollup.js:19799:22
at async Promise.all (index 2)
at async ModuleLoader.fetchStaticDependencies (/app/baixiangguo-client/node_modules/rollup/dist/shared/rollup.js:19797:34)
at async Promise.all (index 0)
at async ModuleLoader.fetchModule (/app/baixiangguo-client/node_modules/rollup/dist/shared/rollup.js:19773:9)
at async Promise.all (index 3)
error Command failed with exit code 1.
色々調べてみて、rolupoptionを調べたりしたが、なんのこっちゃない、
場所が分からんのかも?と気づいてassetsをsrcの下にあることを明示したらい解決。
vite.config.ts
{ find: 'assets', replacement: 'src/assets'}]