mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-12-01 17:43:15 +00:00
preparing for npm publish
This commit is contained in:
@@ -1,9 +1,36 @@
|
||||
import path from "path"
|
||||
import react from "@vitejs/plugin-react"
|
||||
import { defineConfig } from "vite"
|
||||
import dts from "vite-plugin-dts";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
build: {
|
||||
//Specifies that the output of the build will be a library.
|
||||
lib: {
|
||||
//Defines the entry point for the library build. It resolves
|
||||
//to src/index.ts,indicating that the library starts from this file.
|
||||
entry: path.resolve(__dirname, "src/index.ts"),
|
||||
name: "docsgpt-widget",
|
||||
//A function that generates the output file
|
||||
//name for different formats during the build
|
||||
fileName: (format) => `index.${format}.js`,
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ["react", "react-dom"],
|
||||
output: {
|
||||
globals: {
|
||||
react: "React",
|
||||
"react-dom": "ReactDOM",
|
||||
},
|
||||
},
|
||||
},
|
||||
//Generates sourcemaps for the built files,
|
||||
//aiding in debugging.
|
||||
sourcemap: true,
|
||||
//Clears the output directory before building.
|
||||
emptyOutDir: true,
|
||||
},
|
||||
plugins: [react(), dts()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
|
||||
Reference in New Issue
Block a user