Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
build(workspace): vite config build external dependency
dushusird9a40a23f685
diff --git a/examples/univer-preact-ts/vite.config.ts b/examples/univer-preact-ts/vite.config.tsindex c54fbce33a..91ae307a59 100644--- a/examples/univer-preact-ts/vite.config.ts+++ b/examples/univer-preact-ts/vite.config.ts@@ -46,6 +46,7 @@ export default defineConfig({// '@univer/core': '@univer/core',// '@univer/style-universheet': '@univer/style-universheet',// preact: 'preact',+ react: 'react',},}),],diff --git a/packages/base-component/vite.config.ts b/packages/base-component/vite.config.tsindex 379e3e127e..b5c66a9a42 100644--- a/packages/base-component/vite.config.ts+++ b/packages/base-component/vite.config.ts@@ -46,11 +46,10 @@ export default defineConfig({createExternal({externals: {'@univer/core': '@univer/core',+ '@univer/base-render': '@univer/base-render','css-vars-ponyfill': 'css-vars-ponyfill','react-colorful': 'react-colorful',- // TODO: build ,still have "new Component$1()).isPureReactComponent"- preact: 'preact',- react: 'react',+ preact: 'preact'},}),],diff --git a/packages/base-numfmt-engine/vite.config.ts b/packages/base-numfmt-engine/vite.config.tsindex 62bf41dd69..cb044e50f8 100644--- a/packages/base-numfmt-engine/vite.config.ts+++ b/packages/base-numfmt-engine/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/base-sheets/vite.config.ts b/packages/base-sheets/vite.config.tsindex ff4dc17771..644c35f398 100644--- a/packages/base-sheets/vite.config.ts+++ b/packages/base-sheets/vite.config.ts@@ -55,8 +55,12 @@ export default defineConfig({externals: {'@univer/core': '@univer/core','@univer/base-render': '@univer/base-render',+ '@univer/base-component': '@univer/base-component','@univer/style-universheet': '@univer/style-universheet',+ 'css-vars-ponyfill': 'css-vars-ponyfill',+ 'nanoid': 'nanoid',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/common-plugin-data/package.json b/packages/common-plugin-data/package.jsonindex b6779c797b..594439eac3 100644--- a/packages/common-plugin-data/package.json+++ b/packages/common-plugin-data/package.json@@ -44,6 +44,7 @@"ts-jest": "29.0.1","ts-node": "^10.2.1","typescript": "^4.4.1-rc",- "vite": "^2.4.4"+ "vite": "^2.4.4",+ "vite-plugin-external": "1.2.3"}}diff --git a/packages/common-plugin-data/vite.config.ts b/packages/common-plugin-data/vite.config.tsindex ac5c7eac3c..4a615d6875 100644--- a/packages/common-plugin-data/vite.config.ts+++ b/packages/common-plugin-data/vite.config.ts@@ -1,6 +1,7 @@import { defineConfig } from 'vite';import { name, version } from './package.json';import path from 'path';+import createExternal from 'vite-plugin-external';const resolve = (url: string) => path.resolve(__dirname, url);@@ -27,6 +28,13 @@ export default defineConfig({port: 3102,open: true, // // Automatically open the app in the browser on server start.},+ plugins: [+ createExternal({+ externals: {+ '@univer/core': '@univer/core'+ },+ }),+ ],resolve: {alias: {'@': path.resolve(__dirname, 'src'),diff --git a/packages/core/package.json b/packages/core/package.jsonindex 7a033fa12d..96114263fa 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -54,6 +54,6 @@"ts-node": "^10.9.1","typescript": "^4.7.4","vite": "^3.0.9",- "vite-plugin-external": "1.2.4"+ "vite-plugin-external": "1.2.3"}}diff --git a/packages/core/vite.config.ts b/packages/core/vite.config.tsindex 0aa6cb4a29..3e9fa8bc77 100644--- a/packages/core/vite.config.ts+++ b/packages/core/vite.config.ts@@ -34,19 +34,20 @@ export default defineConfig({port: 3102,open: true, // // Automatically open the app in the browser on server start.},-+ plugins: [+ createExternal({+ externals: {+ 'dayjs': 'dayjs',+ 'nanoid': 'nanoid',+ 'numeral': 'numeral',+ 'es6-proxy-polyfill': 'es6-proxy-polyfill',+ 'reflect-metadata': 'reflect-metadata',+ },+ }),+ ],resolve: {alias: {// '@': path.resolve(__dirname, 'src'),},},-- plugins: [- // createExternal({- // externals: {- // 'es6-proxy-polyfill': 'es6-proxy-polyfill',- // 'reflect-metadata': 'reflect-metadata',- // },- // }),- ],});diff --git a/packages/sheets-plugin-alternating-colors/vite.config.ts b/packages/sheets-plugin-alternating-colors/vite.config.tsindex b5419bdd04..c321db4dda 100644--- a/packages/sheets-plugin-alternating-colors/vite.config.ts+++ b/packages/sheets-plugin-alternating-colors/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-clipboard/vite.config.ts b/packages/sheets-plugin-clipboard/vite.config.tsindex ac009fda9b..148cbfa510 100644--- a/packages/sheets-plugin-clipboard/vite.config.ts+++ b/packages/sheets-plugin-clipboard/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-comment/vite.config.ts b/packages/sheets-plugin-comment/vite.config.tsindex 894f4f3abe..23ed02f81e 100644--- a/packages/sheets-plugin-comment/vite.config.ts+++ b/packages/sheets-plugin-comment/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-conditional-format/vite.config.ts b/packages/sheets-plugin-conditional-format/vite.config.tsindex a05619ea2e..71b35c12b6 100644--- a/packages/sheets-plugin-conditional-format/vite.config.ts+++ b/packages/sheets-plugin-conditional-format/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-data-validation/vite.config.ts b/packages/sheets-plugin-data-validation/vite.config.tsindex 10c992db0d..8733b912b5 100644--- a/packages/sheets-plugin-data-validation/vite.config.ts+++ b/packages/sheets-plugin-data-validation/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-filter/vite.config.ts b/packages/sheets-plugin-filter/vite.config.tsindex 4ebbde26f6..bd472b0808 100644--- a/packages/sheets-plugin-filter/vite.config.ts+++ b/packages/sheets-plugin-filter/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-find/vite.config.ts b/packages/sheets-plugin-find/vite.config.tsindex 803d7fbc8e..2c1d01de6d 100644--- a/packages/sheets-plugin-find/vite.config.ts+++ b/packages/sheets-plugin-find/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-freeze/vite.config.ts b/packages/sheets-plugin-freeze/vite.config.tsindex 0c220fca2b..b55f66c64e 100644--- a/packages/sheets-plugin-freeze/vite.config.ts+++ b/packages/sheets-plugin-freeze/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-image/vite.config.ts b/packages/sheets-plugin-image/vite.config.tsindex 530cae8ec2..e7cc552e72 100644--- a/packages/sheets-plugin-image/vite.config.ts+++ b/packages/sheets-plugin-image/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-link/vite.config.ts b/packages/sheets-plugin-link/vite.config.tsindex e9d9ffc61c..f634bd0a6f 100644--- a/packages/sheets-plugin-link/vite.config.ts+++ b/packages/sheets-plugin-link/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-numfmt/src/Basic/Const/index.ts b/packages/sheets-plugin-numfmt/src/Basic/Const/index.tsindex 59d17bb2ce..2b474bd8b6 100644--- a/packages/sheets-plugin-numfmt/src/Basic/Const/index.ts+++ b/packages/sheets-plugin-numfmt/src/Basic/Const/index.ts@@ -2,4 +2,5 @@export * from './DEFAULT_DATA';export * from './FORMATDETAIL';export * from './PLUGIN_NAME';+export * from './CONFIG';// @endindexdiff --git a/packages/sheets-plugin-numfmt/src/Controller/NumfmtController.ts b/packages/sheets-plugin-numfmt/src/Controller/NumfmtController.tsindex c7c7beb4f3..29039c668a 100644--- a/packages/sheets-plugin-numfmt/src/Controller/NumfmtController.ts+++ b/packages/sheets-plugin-numfmt/src/Controller/NumfmtController.ts@@ -6,7 +6,7 @@ import { NUMFMT_PLUGIN_NAME } from '../Basic/Const';import { DEFAULT_DATA } from '../Basic/Const/DEFAULT_DATA';import { NumfmtPlugin } from '../NumfmtPlugin';import styles from '../View/UI/index.module.less';-import { NumftmConfig } from '../Basic/Const/Config';+import { NumftmConfig } from '../Basic/Const';export class NumfmtController {protected _model: NumfmtModel;diff --git a/packages/sheets-plugin-numfmt/vite.config.ts b/packages/sheets-plugin-numfmt/vite.config.tsindex eba9965fd4..75431f6326 100644--- a/packages/sheets-plugin-numfmt/vite.config.ts+++ b/packages/sheets-plugin-numfmt/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-pivot-table/vite.config.ts b/packages/sheets-plugin-pivot-table/vite.config.tsindex 133930c3c2..eb62f73d14 100644--- a/packages/sheets-plugin-pivot-table/vite.config.ts+++ b/packages/sheets-plugin-pivot-table/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-print/vite.config.ts b/packages/sheets-plugin-print/vite.config.tsindex f38491edbe..90e6ff3c02 100644--- a/packages/sheets-plugin-print/vite.config.ts+++ b/packages/sheets-plugin-print/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-protection/vite.config.ts b/packages/sheets-plugin-protection/vite.config.tsindex 4641697e8c..23d7461bc6 100644--- a/packages/sheets-plugin-protection/vite.config.ts+++ b/packages/sheets-plugin-protection/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-screenshot/vite.config.ts b/packages/sheets-plugin-screenshot/vite.config.tsindex 03ef67b5e5..bebb283fb0 100644--- a/packages/sheets-plugin-screenshot/vite.config.ts+++ b/packages/sheets-plugin-screenshot/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-sort/vite.config.ts b/packages/sheets-plugin-sort/vite.config.tsindex 09220cea53..c57e5edc91 100644--- a/packages/sheets-plugin-sort/vite.config.ts+++ b/packages/sheets-plugin-sort/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/sheets-plugin-split-column/vite.config.ts b/packages/sheets-plugin-split-column/vite.config.tsindex 3eb9da45f6..d65e2ecf34 100644--- a/packages/sheets-plugin-split-column/vite.config.ts+++ b/packages/sheets-plugin-split-column/vite.config.ts@@ -41,6 +41,7 @@ export default defineConfig({'@univer/core': '@univer/core','@univer/style-universheet': '@univer/style-universheet',preact: 'preact',+ react: 'react',},}),],diff --git a/packages/style-universheet/vite.config.ts b/packages/style-universheet/vite.config.tsindex cdfbdcdee9..34b1fc2709 100644--- a/packages/style-universheet/vite.config.ts+++ b/packages/style-universheet/vite.config.ts@@ -46,9 +46,10 @@ export default defineConfig({createExternal({externals: {'@univer/core': '@univer/core',+ '@univer/base-component': '@univer/base-component','css-vars-ponyfill': 'css-vars-ponyfill',+ 'nanoid': 'nanoid','react-colorful': 'react-colorful',- // TODO: build ,still have "new Component$1()).isPureReactComponent"preact: 'preact',react: 'react',},