jquery项目改成vue+vite项目报错 #8710
Unanswered
GaryMK
asked this question in
Help/Questions
Replies: 1 comment
-
先确认你自己写的script标签上的资源是否是esm模式,不是的话删除 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
项目原来是jquery的,在改成vue项目后报错,本人新入vue,求大佬指教,感谢!
npm run dev 以后有如下问题,但是页面能正常显示
npm run build 以后有如下问题,但是页面直接空白
以下是涉及的一些源码
`
<title>Test</title>// index.html
`
// vite.config.js
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})
`
js库的路径是这样的
Beta Was this translation helpful? Give feedback.
All reactions