From adbe940f60e82a800fb66c572b66462af013e450 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 1 Feb 2023 22:03:50 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=87=AA=E5=8A=A8remove=20debugger?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh/guide/advance/column-type.md | 2 +- packages/fast-admin/fs-admin-antdv | 2 +- packages/fast-admin/fs-admin-element | 2 +- packages/fast-admin/fs-admin-naive-ui | 2 +- packages/fast-extends/vite.config.js | 1 + packages/ui/ui-antdv/vite.config.js | 89 ++++++++++++------------ packages/ui/ui-element/vite.config.js | 89 ++++++++++++------------ packages/ui/ui-interface/vite.config.js | 87 +++++++++++------------ packages/ui/ui-naive/vite.config.js | 91 +++++++++++++------------ 9 files changed, 189 insertions(+), 176 deletions(-) diff --git a/docs/zh/guide/advance/column-type.md b/docs/zh/guide/advance/column-type.md index 6ec31b4e..b4a5a13a 100644 --- a/docs/zh/guide/advance/column-type.md +++ b/docs/zh/guide/advance/column-type.md @@ -231,7 +231,7 @@ selectType.column.component.color='auto' //修改官方的字段类型,设置 ## 字段merge插件 当你想自定义columns额外处理方法时可以使用 `registerMergeColumnPlugin` 来注册字段merge插件。 -可以帮助你实现类似`dict`公共属性的功能 +可以帮助你实现类似`dict`、`type`等公共属性的功能 ```js import { useColumns,MergeColumnPlugin } from '@fast-crud/fast-crud' diff --git a/packages/fast-admin/fs-admin-antdv b/packages/fast-admin/fs-admin-antdv index abbc90b0..3b018f1e 160000 --- a/packages/fast-admin/fs-admin-antdv +++ b/packages/fast-admin/fs-admin-antdv @@ -1 +1 @@ -Subproject commit abbc90b078c856a010f3e4f4823bfb7a3c2c8105 +Subproject commit 3b018f1eeeff1d477ebd5d762777452f03fbf9a8 diff --git a/packages/fast-admin/fs-admin-element b/packages/fast-admin/fs-admin-element index fe7bef66..e859b182 160000 --- a/packages/fast-admin/fs-admin-element +++ b/packages/fast-admin/fs-admin-element @@ -1 +1 @@ -Subproject commit fe7bef662d91251eb220851ecda4214f91873cf9 +Subproject commit e859b1821dab47f411da7736d19d811ece7ae025 diff --git a/packages/fast-admin/fs-admin-naive-ui b/packages/fast-admin/fs-admin-naive-ui index 23edc3df..eb5c8c29 160000 --- a/packages/fast-admin/fs-admin-naive-ui +++ b/packages/fast-admin/fs-admin-naive-ui @@ -1 +1 @@ -Subproject commit 23edc3df49b2de04bf35e8d2825899a887c7c5e8 +Subproject commit eb5c8c2958f399b7761f575fddbcaa411aaeabf8 diff --git a/packages/fast-extends/vite.config.js b/packages/fast-extends/vite.config.js index 91f712b5..b8dc9a10 100644 --- a/packages/fast-extends/vite.config.js +++ b/packages/fast-extends/vite.config.js @@ -29,6 +29,7 @@ export default ({ command, mode }) => { const options = { plugins: [vueJsx(), vue()], esbuild: { + drop: command === "build" ? ["debugger"] : [], jsxFactory: "h", jsxFragment: "Fragment" }, diff --git a/packages/ui/ui-antdv/vite.config.js b/packages/ui/ui-antdv/vite.config.js index 0c18d76e..b8189f58 100644 --- a/packages/ui/ui-antdv/vite.config.js +++ b/packages/ui/ui-antdv/vite.config.js @@ -6,51 +6,54 @@ import strip from "@rollup/plugin-strip"; import typescript from "@rollup/plugin-typescript"; const { resolve } = path; // https://vitejs.dev/config/ -export default { - plugins: [vueJsx(), vue()], - esbuild: { - jsxFactory: "h", - jsxFragment: "Fragment" - }, - build: { - lib: { - entry: resolve(__dirname, "src/index.ts"), - name: "index" +export default ({ command, mode }) => { + return { + plugins: [vueJsx(), vue()], + esbuild: { + drop: command === "build" ? ["debugger"] : [], + jsxFactory: "h", + jsxFragment: "Fragment" }, - // cssCodeSplit: true, - sourcemap: "inline", - // minify: false, - rollupOptions: { - // input: { - // main: resolve(__dirname, "src/index.js"), - // en: resolve(__dirname, "src/local/lang/en.js"), - // }, - plugins: [ - strip(), - visualizer(), - typescript({ - target: "es2020", - rootDir: "src", - declaration: true, - declarationDir: "dist/d", - exclude: "./node_modules/**", - allowSyntheticDefaultImports: true - }) - ], - // make sure to externalize deps that shouldn't be bundled - // into your library - external: ["vue", "@fast-crud/fast-crud", "ant-design-vue", "@ant-design/icons-vue", "lodash-es"], - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - vue: "Vue", - "@fast-crud/fast-crud": "FastCrud", - "ant-design-vue": "Antdv", - "@ant-design/icons-vue": "IconsVue", - "lodash-es": "_" + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: "index" + }, + // cssCodeSplit: true, + sourcemap: "inline", + // minify: false, + rollupOptions: { + // input: { + // main: resolve(__dirname, "src/index.js"), + // en: resolve(__dirname, "src/local/lang/en.js"), + // }, + plugins: [ + strip(), + visualizer(), + typescript({ + target: "es2020", + rootDir: "src", + declaration: true, + declarationDir: "dist/d", + exclude: "./node_modules/**", + allowSyntheticDefaultImports: true + }) + ], + // make sure to externalize deps that shouldn't be bundled + // into your library + external: ["vue", "@fast-crud/fast-crud", "ant-design-vue", "@ant-design/icons-vue", "lodash-es"], + output: { + // Provide global variables to use in the UMD build + // for externalized deps + globals: { + vue: "Vue", + "@fast-crud/fast-crud": "FastCrud", + "ant-design-vue": "Antdv", + "@ant-design/icons-vue": "IconsVue", + "lodash-es": "_" + } } } } - } + }; }; diff --git a/packages/ui/ui-element/vite.config.js b/packages/ui/ui-element/vite.config.js index 9a0198c8..f2e4c1eb 100644 --- a/packages/ui/ui-element/vite.config.js +++ b/packages/ui/ui-element/vite.config.js @@ -6,51 +6,54 @@ import strip from "@rollup/plugin-strip"; import typescript from "@rollup/plugin-typescript"; const { resolve } = path; // https://vitejs.dev/config/ -export default { - plugins: [vueJsx(), vue()], - esbuild: { - jsxFactory: "h", - jsxFragment: "Fragment" - }, - build: { - lib: { - entry: resolve(__dirname, "src/index.ts"), - name: "element" +export default ({ command, mode }) => { + return { + plugins: [vueJsx(), vue()], + esbuild: { + drop: command === "build" ? ["debugger"] : [], + jsxFactory: "h", + jsxFragment: "Fragment" }, - // cssCodeSplit: true, - sourcemap: "inline", - // minify: false, - rollupOptions: { - // input: { - // main: resolve(__dirname, "src/index.js"), - // en: resolve(__dirname, "src/local/lang/en.js"), - // }, - plugins: [ - strip(), - visualizer(), - typescript({ - target: "es2020", - rootDir: "src", - declaration: true, - declarationDir: "dist/d", - exclude: "./node_modules/**", - allowSyntheticDefaultImports: true - }) - ], - // make sure to externalize deps that shouldn't be bundled - // into your library - external: ["vue", "@fast-crud/fast-crud", "element-plus", "@element-plus/icons-vue", "lodash-es"], - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - vue: "Vue", - "@fast-crud/fast-crud": "FastCrud", - "element-plus": "ElementPlus", - "@element-plus/icons-vue": "ElementPlusIcons", - "lodash-es": "_" + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: "element" + }, + // cssCodeSplit: true, + sourcemap: "inline", + // minify: false, + rollupOptions: { + // input: { + // main: resolve(__dirname, "src/index.js"), + // en: resolve(__dirname, "src/local/lang/en.js"), + // }, + plugins: [ + strip(), + visualizer(), + typescript({ + target: "es2020", + rootDir: "src", + declaration: true, + declarationDir: "dist/d", + exclude: "./node_modules/**", + allowSyntheticDefaultImports: true + }) + ], + // make sure to externalize deps that shouldn't be bundled + // into your library + external: ["vue", "@fast-crud/fast-crud", "element-plus", "@element-plus/icons-vue", "lodash-es"], + output: { + // Provide global variables to use in the UMD build + // for externalized deps + globals: { + vue: "Vue", + "@fast-crud/fast-crud": "FastCrud", + "element-plus": "ElementPlus", + "@element-plus/icons-vue": "ElementPlusIcons", + "lodash-es": "_" + } } } } - } + }; }; diff --git a/packages/ui/ui-interface/vite.config.js b/packages/ui/ui-interface/vite.config.js index 7f229705..f5de067f 100644 --- a/packages/ui/ui-interface/vite.config.js +++ b/packages/ui/ui-interface/vite.config.js @@ -6,50 +6,53 @@ import strip from "@rollup/plugin-strip"; const { resolve } = path; import typescript from "@rollup/plugin-typescript"; // https://vitejs.dev/config/ -export default { - plugins: [vueJsx(), vue()], - esbuild: { - jsxFactory: "h", - jsxFragment: "Fragment" - }, - build: { - lib: { - entry: resolve(__dirname, "src/index.ts"), - name: "antdv" +export default ({ command, mode }) => { + return { + plugins: [vueJsx(), vue()], + esbuild: { + drop: command === "build" ? ["debugger"] : [], + jsxFactory: "h", + jsxFragment: "Fragment" }, - // cssCodeSplit: true, - sourcemap: "inline", - // minify: false, - rollupOptions: { - // input: { - // main: resolve(__dirname, "src/index.js"), - // en: resolve(__dirname, "src/local/lang/en.js"), - // }, - plugins: [ - strip(), - visualizer(), - typescript({ - target: "es2020", - rootDir: "src", - declaration: true, - declarationDir: "dist/d", - exclude: "./node_modules/**", - allowSyntheticDefaultImports: true - }) - ], - // make sure to externalize deps that shouldn't be bundled - // into your library - external: ["vue", "@fast-crud/fast-crud", "ant-design-vue", "@ant-design/icons-vue"], - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - vue: "Vue", - "@fast-crud/fast-crud": "FastCrud", - "ant-design-vue": "Antdv", - "@ant-design/icons-vue": "IconsVue" + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: "antdv" + }, + // cssCodeSplit: true, + sourcemap: "inline", + // minify: false, + rollupOptions: { + // input: { + // main: resolve(__dirname, "src/index.js"), + // en: resolve(__dirname, "src/local/lang/en.js"), + // }, + plugins: [ + strip(), + visualizer(), + typescript({ + target: "es2020", + rootDir: "src", + declaration: true, + declarationDir: "dist/d", + exclude: "./node_modules/**", + allowSyntheticDefaultImports: true + }) + ], + // make sure to externalize deps that shouldn't be bundled + // into your library + external: ["vue", "@fast-crud/fast-crud", "ant-design-vue", "@ant-design/icons-vue"], + output: { + // Provide global variables to use in the UMD build + // for externalized deps + globals: { + vue: "Vue", + "@fast-crud/fast-crud": "FastCrud", + "ant-design-vue": "Antdv", + "@ant-design/icons-vue": "IconsVue" + } } } } - } + }; }; diff --git a/packages/ui/ui-naive/vite.config.js b/packages/ui/ui-naive/vite.config.js index 2e0399e0..998c8b63 100644 --- a/packages/ui/ui-naive/vite.config.js +++ b/packages/ui/ui-naive/vite.config.js @@ -6,52 +6,55 @@ import strip from "@rollup/plugin-strip"; import typescript from "@rollup/plugin-typescript"; const { resolve } = path; // https://vitejs.dev/config/ -export default { - plugins: [vueJsx(), vue()], - esbuild: { - jsxFactory: "h", - jsxFragment: "Fragment" - }, - build: { - lib: { - entry: resolve(__dirname, "src/index.ts"), - name: "naive" +export default ({ command, mode }) => { + return { + plugins: [vueJsx(), vue()], + esbuild: { + drop: command === "build" ? ["debugger"] : [], + jsxFactory: "h", + jsxFragment: "Fragment" }, - // cssCodeSplit: true, - sourcemap: "inline", - // minify: false, - rollupOptions: { - // input: { - // main: resolve(__dirname, "src/index.js"), - // en: resolve(__dirname, "src/local/lang/en.js"), - // }, - plugins: [ - strip(), - visualizer(), - typescript({ - target: "es2020", - rootDir: "src", - declaration: true, - declarationDir: "dist/d", - exclude: "./node_modules/**", - allowSyntheticDefaultImports: true - }) - ], - // make sure to externalize deps that shouldn't be bundled - // into your library - external: ["vue", "@fast-crud/fast-crud", "naive-ui", "@ant-design/icons-vue", "lodash-es"], - output: { - // Provide global variables to use in the UMD build - // for externalized deps - globals: { - vue: "Vue", - "@fast-crud/fast-crud": "FastCrud", - "ant-design-vue": "Antdv", - "naive-ui": "Naive", - "@ant-design/icons-vue": "IconsVue", - "lodash-es": "_" + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: "naive" + }, + // cssCodeSplit: true, + sourcemap: "inline", + // minify: false, + rollupOptions: { + // input: { + // main: resolve(__dirname, "src/index.js"), + // en: resolve(__dirname, "src/local/lang/en.js"), + // }, + plugins: [ + strip(), + visualizer(), + typescript({ + target: "es2020", + rootDir: "src", + declaration: true, + declarationDir: "dist/d", + exclude: "./node_modules/**", + allowSyntheticDefaultImports: true + }) + ], + // make sure to externalize deps that shouldn't be bundled + // into your library + external: ["vue", "@fast-crud/fast-crud", "naive-ui", "@ant-design/icons-vue", "lodash-es"], + output: { + // Provide global variables to use in the UMD build + // for externalized deps + globals: { + vue: "Vue", + "@fast-crud/fast-crud": "FastCrud", + "ant-design-vue": "Antdv", + "naive-ui": "Naive", + "@ant-design/icons-vue": "IconsVue", + "lodash-es": "_" + } } } } - } + }; };