Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Generates JS files inside src folder.  #11

@araratmartirossyan

Description

@araratmartirossyan
  import { defineConfig } from 'vite';
  import react from '@vitejs/plugin-react';
  import dts from 'vite-dts';
  import { resolve } from 'path';
  import Icons from 'unplugin-icons/vite';
  
  export default defineConfig({
    plugins: [
      dts(),
      Icons(),
      react({
        babel: {
          plugins: ['macros']
        }
      })
    ],
    build: {
      lib: {
        entry: resolve('src', 'App.tsx'),
        formats: ['es'],
        name: 'labour-rates-generic',
        fileName: (format) => `labour-rates-generic.${format}.js` //put the name of your lib
      },
      rollupOptions: {
        external: ['react', 'react-dom']
      }
    }
  });

Trying to use dts, but the output generates js files inside the src folder. Maybe I'm doing something wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions