Questions tagged [vite]

For questions about using Vite, a two-part build tool (dev server + build command) that aims to provide a faster and leaner development experience for modern web projects.

4741 questions
12
votes
4 answers

Vite import CSS with alias in main.ts

I'm trying to replace vue-cli with vite. I have a vite.config.js so I can use alias for imports: export default { alias: { '@': require('path').resolve(__dirname, 'src'), }, }; Then in my main.ts I try to import my css file (I tried…
Thomas
  • 6,325
  • 4
  • 30
  • 65
11
votes
3 answers

How import own js file into vite?

I use Laravel with Vite and I want to add file with Vanillia JS code. Before I used mix and I have never use Vite before. I tryed add this code into file vite.config.js like below example: laravel({ input: [ 'resources/sass/app.scss', …
wtsuport
  • 315
  • 1
  • 3
  • 9
11
votes
1 answer

How can I turn off ViteJS's Hot Module Reload?

I have a server side rendered production mode Vite application. My issue is that: routinely the webpage will reload and the console will display [vite] connecting.... I traced this back to the hot module reload portion of vite's codebase. However, I…
now_world
  • 940
  • 7
  • 21
  • 56
11
votes
1 answer

How to exclude JS script from the bundle when building app with vite?

Due to another issue, I have to import a JS dependency statically in HTML in my vue3 application. /index.html