gc_i18n 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vite.config.js ADDED
@@ -0,0 +1,42 @@
1
+ import { defineConfig } from "vite";
2
+ import vue from "@vitejs/plugin-vue";
3
+ import vueJsx from "@vitejs/plugin-vue-jsx";
4
+ import { resolve } from "path";
5
+ import libCss from "vite-plugin-libcss";
6
+ import terser from "@rollup/plugin-terser"; // 不用解构出来 有默认导出
7
+
8
+ // https://vite.dev/config/
9
+ export default defineConfig({
10
+ build: {
11
+ sourcemap: false, // 可选:生成源代码映射文件
12
+ lib: {
13
+ // Could also be a dictionary or array of multiple entry points
14
+ entry: resolve(__dirname, "packages/index.js"),
15
+ name: "gc_i18n",
16
+ fileName: "gc_i18n"
17
+ },
18
+
19
+ rollupOptions: {
20
+ terserOptions: false,
21
+ // 确保外部化处理那些你不想打包进库的依赖
22
+ external: ["vue", "axios", "lodash-es", "view-ui-plus"],
23
+ output: {
24
+ // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
25
+ globals: {
26
+ vue: "Vue",
27
+ axios: "Axios",
28
+ lodash: "_"
29
+ },
30
+ plugins: [
31
+ terser({
32
+ compress: {
33
+ drop_console: true
34
+ }
35
+ })
36
+ ]
37
+ }
38
+ },
39
+ outDir: "lib"
40
+ },
41
+ plugins: [vue(), vueJsx(), libCss()]
42
+ });