From 3b17d504f020fa1d50ba5b7cb77aeb4c2ed579dd Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 31 Dec 2021 19:24:51 -0800 Subject: [PATCH 1/4] fix Svelte packaging --- packages/core/rollup.config.js | 2 +- packages/svelte/package.json | 6 +++--- packages/svelte/rollup.config.js | 17 ----------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index b77e48ba6d..3203d5d783 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -9,7 +9,7 @@ export default { input: './src/index.ts', output: { file: `./dist/bundle.js`, - format: 'umd', + format: 'cjs', name: 'Charts', globals: { 'd3-scale': 'd3Scale', diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 2d8c32dc9a..7fc646da04 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -2,9 +2,9 @@ "name": "@carbon/charts-svelte", "version": "0.54.0", "description": "Carbon charting components for Svelte", - "main": "./bundle.js", - "module": "./index.js", - "svelte": "./src/index.js", + "type": "module", + "main": "./index.js", + "svelte": "./index.js", "types": "./types/index.d.ts", "scripts": { "start": "yarn run storybook", diff --git a/packages/svelte/rollup.config.js b/packages/svelte/rollup.config.js index a67134697e..91b1543cb1 100644 --- a/packages/svelte/rollup.config.js +++ b/packages/svelte/rollup.config.js @@ -3,23 +3,6 @@ import resolve from "rollup-plugin-node-resolve"; import svelte from "rollup-plugin-svelte"; export default [ - { - input: "./src/index.js", - output: { - file: "./dist/bundle.js", - format: "umd", - name: "ChartsSvelte", - globals: { - "@carbon/charts": "Charts" - } - }, - plugins: [ - svelte(), - resolve(), - terser() - ], - external: ["svelte", "@carbon/charts"] - }, { input: "./src/index.js", output: { From afdc256d2afb4e3d4cf66988553b87223cf6bd0e Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sat, 1 Jan 2022 13:59:40 -0800 Subject: [PATCH 2/4] Remove Rollup config for Svelte package --- packages/svelte/package.json | 4 ++-- packages/svelte/rollup.config.js | 18 ------------------ 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 packages/svelte/rollup.config.js diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 7fc646da04..cce892953d 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -3,8 +3,8 @@ "version": "0.54.0", "description": "Carbon charting components for Svelte", "type": "module", - "main": "./index.js", - "svelte": "./index.js", + "main": "./src/index.js", + "svelte": "./src/index.js", "types": "./types/index.d.ts", "scripts": { "start": "yarn run storybook", diff --git a/packages/svelte/rollup.config.js b/packages/svelte/rollup.config.js deleted file mode 100644 index 91b1543cb1..0000000000 --- a/packages/svelte/rollup.config.js +++ /dev/null @@ -1,18 +0,0 @@ -import { terser } from "rollup-plugin-terser"; -import resolve from "rollup-plugin-node-resolve"; -import svelte from "rollup-plugin-svelte"; - -export default [ - { - input: "./src/index.js", - output: { - file: "./dist/index.js", - format: "es" - }, - plugins: [ - svelte(), - resolve() - ], - external: ["svelte", "@carbon/charts"] - } -]; From e8bcaf538367e2ab1f9d43a965d84cc957bd44ac Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sat, 1 Jan 2022 16:26:28 -0800 Subject: [PATCH 3/4] remove rollup from build file --- packages/svelte/build.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/svelte/build.sh b/packages/svelte/build.sh index 636156dc47..c126f38177 100644 --- a/packages/svelte/build.sh +++ b/packages/svelte/build.sh @@ -3,15 +3,13 @@ set -e rm -rf dist +mkdir dist echo "linking local packages (non-lerna)" # we run this outside of lerna, since lerna seems to have issues with correctly linking to the dist rm -f node_modules/@carbon/charts ln -sf $(pwd)/../core/dist node_modules/@carbon/charts -echo "bundling..." -rollup -c - # copy src directory for Svelte entry cp -r src/ dist/src From 7771eec4e0a01623b2f42d0ff7173531f7b06815 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Thu, 20 Jan 2022 21:08:04 -0800 Subject: [PATCH 4/4] revert change to core package --- packages/core/rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index 3203d5d783..b77e48ba6d 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -9,7 +9,7 @@ export default { input: './src/index.ts', output: { file: `./dist/bundle.js`, - format: 'cjs', + format: 'umd', name: 'Charts', globals: { 'd3-scale': 'd3Scale',