Speeding up the ViteJs development model: Vue 3
P粉953231781
P粉953231781 2023-10-31 13:42:49
0
1
878

Can someone help me speed up my ViteJs server?

The problem is that the server is very slow in development mode. I start the server, then launch the page in the browser and wait 3-6 minutes for the page to load! Initially, ViteJs downloads a few kilobytes of the resource and then the request is in "pending" status for 2-3 minutes.

Then it will start loading all resources every time. Although I also specified in the config that all css should be local.

Page reloading is also very slow.

I started the project like this:

vite

This is my configuration:

import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": resolve(__dirname, "./src"),
    },
  },
  publicDir: 'public',
  server: {
    port: 8080,
    watch: {
      usePolling: true,
      ignored: ['!**/bundle/**', '!**/lib/**']
    }
  },
  css: {
    modules: {
      scopeBehaviour: "local"
    }
  },
  preview: {
    port: 8080,
  }
})


P粉953231781
P粉953231781

reply all(1)
P粉037880905

Wow, the problem is in WSL2! Just tried booting vite from Windows out of interest. Start page loads in 1 second! I think I solved my problem myself! Thanks!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template