Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
How to inject production script and css to an index html with vite?

My vite.config.ts is:

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
    plugins: [react()],
    publicDir: './src/assets',
    build: {
        lib: {
            entry: './src/main.tsx',
            name: 'index',
            fileName: 'index',
            formats: ['iife']
        }
    },
    server: {
        host: true
    }
});

How can I run the production script and css automatically in an html index?

like webpack does with html-webpack-plugin.

I'm new to vite (and to webpack too haha) and at least I couldn't find any configuration that would allow me to do something like that, is there a way to do it?

I hope you can help me c:

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!