From 972609481301069a58ade5c8cd5f9cb669827683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B7=91=E5=B3=B0?= Date: Thu, 13 Jul 2023 14:13:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=8F=AA=E6=89=93?= =?UTF-8?q?=E5=8C=85esm=E7=9A=84npm=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + packages/amis-core/package.json | 1 + packages/amis-core/rollup.esm.config.js | 5 +++++ packages/amis-editor-core/package.json | 1 + packages/amis-editor-core/rollup.esm.config.js | 5 +++++ packages/amis-editor/package.json | 1 + packages/amis-editor/rollup.esm.config.js | 5 +++++ packages/amis-formula/package.json | 1 + packages/amis-formula/rollup.esm.config.js | 5 +++++ packages/amis-ui/package.json | 1 + packages/amis-ui/rollup.esm.config.js | 5 +++++ packages/amis/package.json | 1 + packages/amis/rollup.esm.config.js | 5 +++++ packages/office-viewer/package.json | 1 + packages/office-viewer/rollup.esm.config.js | 5 +++++ 15 files changed, 43 insertions(+) create mode 100644 packages/amis-core/rollup.esm.config.js create mode 100644 packages/amis-editor-core/rollup.esm.config.js create mode 100644 packages/amis-editor/rollup.esm.config.js create mode 100644 packages/amis-formula/rollup.esm.config.js create mode 100644 packages/amis-ui/rollup.esm.config.js create mode 100644 packages/amis/rollup.esm.config.js create mode 100644 packages/office-viewer/rollup.esm.config.js diff --git a/package.json b/package.json index 5014a8fba..784438b7a 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "fis3-dev": "fis3 release -cwd ./public", "deploy-gh-page": "sh ./deploy-gh-pages.sh", "build": "npm run build --workspaces", + "build-esm": "npm run build-esm --workspaces", "test": "npm test --workspaces", "update-snapshot": "npm run update-snapshot --workspaces", "prepare": "husky install", diff --git a/packages/amis-core/package.json b/packages/amis-core/package.json index afc1ac348..c1a5fa827 100644 --- a/packages/amis-core/package.json +++ b/packages/amis-core/package.json @@ -34,6 +34,7 @@ }, "scripts": { "build": "npm run clean-dist && NODE_ENV=production rollup -c ", + "build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js", "dev": "rollup -c -w", "test": "jest", "update-snapshot": "jest --updateSnapshot", diff --git a/packages/amis-core/rollup.esm.config.js b/packages/amis-core/rollup.esm.config.js new file mode 100644 index 000000000..888e0c96b --- /dev/null +++ b/packages/amis-core/rollup.esm.config.js @@ -0,0 +1,5 @@ +import config from "./rollup.config"; + +const esmConfig = config[1]; + +export default esmConfig; \ No newline at end of file diff --git a/packages/amis-editor-core/package.json b/packages/amis-editor-core/package.json index ae8999080..6494b4593 100644 --- a/packages/amis-editor-core/package.json +++ b/packages/amis-editor-core/package.json @@ -28,6 +28,7 @@ "scripts": { "test": "echo \"Warnings: no test specified\"", "build": "npm run clean-dist && NODE_ENV=production rollup -c", + "build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js", "clean-dist": "rimraf lib/* esm/*", "i18n:update": "npx i18n update --config=./i18nConfig.js", "i18n:translate": "npx i18n translate --config=./i18nConfig.js --l=en-US", diff --git a/packages/amis-editor-core/rollup.esm.config.js b/packages/amis-editor-core/rollup.esm.config.js new file mode 100644 index 000000000..888e0c96b --- /dev/null +++ b/packages/amis-editor-core/rollup.esm.config.js @@ -0,0 +1,5 @@ +import config from "./rollup.config"; + +const esmConfig = config[1]; + +export default esmConfig; \ No newline at end of file diff --git a/packages/amis-editor/package.json b/packages/amis-editor/package.json index ba5ff792b..c2cb1a962 100644 --- a/packages/amis-editor/package.json +++ b/packages/amis-editor/package.json @@ -22,6 +22,7 @@ "scripts": { "test": "echo \"Warnings: no test specified\"", "build": "npm run clean-dist && NODE_ENV=production rollup -c ", + "build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js", "clean-dist": "rimraf lib/** esm/**", "i18n:update": "npx i18n update --config=./i18nConfig.js", "i18n:translate": "npx i18n translate --config=./i18nConfig.js --l=en-US", diff --git a/packages/amis-editor/rollup.esm.config.js b/packages/amis-editor/rollup.esm.config.js new file mode 100644 index 000000000..888e0c96b --- /dev/null +++ b/packages/amis-editor/rollup.esm.config.js @@ -0,0 +1,5 @@ +import config from "./rollup.config"; + +const esmConfig = config[1]; + +export default esmConfig; \ No newline at end of file diff --git a/packages/amis-formula/package.json b/packages/amis-formula/package.json index e6b927508..407912de8 100644 --- a/packages/amis-formula/package.json +++ b/packages/amis-formula/package.json @@ -7,6 +7,7 @@ "types": "lib/index.d.ts", "scripts": { "build": "npm run clean-dist && npm run genDoc && cross-env NODE_ENV=production rollup -c && cp src/doc.md lib/doc.md && cp src/doc.md esm/doc.md", + "build-esm": "npm run clean-dist && cross-env NODE_ENV=production rollup -c rollup.esm.config.js", "lib": "npm run clean-dist && cross-env NODE_ENV=production IS_LIB=1 rollup -c", "clean-dist": "rimraf lib/**", "declaration": "tsc --project tsconfig-for-declaration.json --allowJs --declaration --emitDeclarationOnly --declarationDir ./lib --rootDir ./src", diff --git a/packages/amis-formula/rollup.esm.config.js b/packages/amis-formula/rollup.esm.config.js new file mode 100644 index 000000000..888e0c96b --- /dev/null +++ b/packages/amis-formula/rollup.esm.config.js @@ -0,0 +1,5 @@ +import config from "./rollup.config"; + +const esmConfig = config[1]; + +export default esmConfig; \ No newline at end of file diff --git a/packages/amis-ui/package.json b/packages/amis-ui/package.json index a2c966eb6..7cfcc847d 100644 --- a/packages/amis-ui/package.json +++ b/packages/amis-ui/package.json @@ -7,6 +7,7 @@ "description": "", "scripts": { "build": "npm run clean-dist && NODE_ENV=production rollup -c ", + "build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js", "dev": "rollup -c -w", "test": "jest", "gen-doc": "ts-node ./scripts/genDoc.ts", diff --git a/packages/amis-ui/rollup.esm.config.js b/packages/amis-ui/rollup.esm.config.js new file mode 100644 index 000000000..888e0c96b --- /dev/null +++ b/packages/amis-ui/rollup.esm.config.js @@ -0,0 +1,5 @@ +import config from "./rollup.config"; + +const esmConfig = config[1]; + +export default esmConfig; \ No newline at end of file diff --git a/packages/amis/package.json b/packages/amis/package.json index 9d43442a9..e972e499e 100644 --- a/packages/amis/package.json +++ b/packages/amis/package.json @@ -11,6 +11,7 @@ "coverage": "jest --coverage", "publish-to-internal": "sh build.sh && sh publish.sh", "build": "npm run clean-dist && sh build.sh", + "build-esm": "npm run clean-dist && NODE_ENV=production rollup -c rollup.esm.config.js", "prettier": "prettier --write '{src,scss,examples}/**/**/*.{js,jsx,ts,tsx,scss,json}'", "build-schemas": "ts-node -O '{\"target\":\"es6\"}' ../../scripts/build-schemas.ts", "clean-dist": "rimraf lib/** esm/**" diff --git a/packages/amis/rollup.esm.config.js b/packages/amis/rollup.esm.config.js new file mode 100644 index 000000000..888e0c96b --- /dev/null +++ b/packages/amis/rollup.esm.config.js @@ -0,0 +1,5 @@ +import config from "./rollup.config"; + +const esmConfig = config[1]; + +export default esmConfig; \ No newline at end of file diff --git a/packages/office-viewer/package.json b/packages/office-viewer/package.json index ec3e0aeae..0bebeecab 100644 --- a/packages/office-viewer/package.json +++ b/packages/office-viewer/package.json @@ -8,6 +8,7 @@ "scripts": { "dev": "vite", "build": "npm run clean-dist && cross-env NODE_ENV=production rollup -c ", + "build-esm": "npm run clean-dist && cross-env NODE_ENV=production rollup -c rollup.esm.config.js", "test": "jest", "lib": "npm run clean-dist && cross-env NODE_ENV=production IS_LIB=1 rollup -c", "update-snapshot": "jest --updateSnapshot", diff --git a/packages/office-viewer/rollup.esm.config.js b/packages/office-viewer/rollup.esm.config.js new file mode 100644 index 000000000..888e0c96b --- /dev/null +++ b/packages/office-viewer/rollup.esm.config.js @@ -0,0 +1,5 @@ +import config from "./rollup.config"; + +const esmConfig = config[1]; + +export default esmConfig; \ No newline at end of file