Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用fetch请求 http://localhost:5176/ 时 404 #163

Open
mr-bing-li opened this issue Sep 25, 2024 · 0 comments
Open

使用fetch请求 http://localhost:5176/ 时 404 #163

mr-bing-li opened this issue Sep 25, 2024 · 0 comments

Comments

@mr-bing-li
Copy link

mr-bing-li commented Sep 25, 2024

报错信息

image

配置项

import { fileURLToPath, URL } from 'node:url'
import { createHtmlPlugin } from 'vite-plugin-html'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    vueJsx(),
    createHtmlPlugin({
      minify: true,
      template: '/src/index.html'
    })
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  server: {
    port: 5176
  }
})

描述

使用插件的template属性修改html的位置后,使用fetch请求就会404。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant