vite.config.ts 701 B

1234567891011121314151617181920212223242526272829
  1. import { defineConfig } from "vite";
  2. import vue from "@vitejs/plugin-vue";
  3. import { resolve } from "path";
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. build: {
  7. lib: {
  8. entry: resolve(__dirname, "src/app/liantong/index.ts"),
  9. name: "liantong",
  10. // the proper extensions will be added
  11. fileName: "liantong",
  12. },
  13. rollupOptions: {
  14. // 确保外部化处理那些你不想打包进库的依赖
  15. external: ["vue"],
  16. output: {
  17. // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
  18. globals: {
  19. vue: "Vue",
  20. },
  21. },
  22. },
  23. },
  24. plugins: [vue()],
  25. server: {
  26. port: 9005,
  27. },
  28. });