Usage with Vite library mode #136
Answered
by
btd
segevfiner
asked this question in
Q&A
-
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { visualizer } from "rollup-plugin-visualizer";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), visualizer()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
lib: {
entry: "src/index.ts",
formats: ["es", "cjs"],
},
sourcemap: true,
},
}); Using the plugin like this will result in a single |
Beta Was this translation helpful? Give feedback.
Answered by
btd
Nov 6, 2022
Replies: 1 comment
-
Hi. sorry for long response. Try add emitFile option, it will output file to output of vite. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
btd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. sorry for long response.
Try add emitFile option, it will output file to output of vite.
Also you can pass env variable