this is my detailed error report :
[vite]: Rollup failed to resolve import "D:/health-promotion-main/ healthapp/src/communityItem.vue" from "uniComponent://Y29tbXVuaXR5SXRlbS52dWU". 21:59:45.486 This is most likely unintended because it can break your application at runtime. 21:59:45.489 If you do want to externalize this module explicitly add it to 21:59:45.493 build .rollup Options. external
The error message indicates that Rollup, the bundler used by vite, failed to resolve the import for D:/health-promotion-main/healthapp/src/communityItem.vue from "uniComponent://Y29tbXVuaXR5SXRlbS52dWU". so consider adding it to the build. rollup Options . external configuration in my vite.config.js file. This tells Rollup to treat the module as external and not attempt to resolve it during the build process. But it did not work ,here are my vite.config.js files:
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
uni(),
],
server: {
hmr: true,
port: 3001,
proxy: {
"/api": {
target: "http://localhost:9090/",
changeOrigin: true,
pathRewrite: {
"^api": "/api"
}
}
}
},
build: {
rollupOptions: {
external: [
'vue',
'./src/pages/community/communityItem.vue',
'./src/pages/community/post_publish/post_publish.vue'
]
}
}
})
I hope there is a big shot who can help me solve this problem, which is very important to me because I have been troubled by it for serval days. I will thank the person who solved this problem