Skip to content

Commit 07c6d29

Browse files
author
Marko Petzold
committed
refactor: move echarts and tinycolor2 to peerDependencies and update Vite configuration
1 parent 8b25ec1 commit 07c6d29

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
"release": "npm run build && npm run types && npm version patch --tag-version-prefix='' && git push && git push --tag && npm run build"
2424
},
2525
"dependencies": {
26-
"echarts": "6.0.0",
2726
"lit": "^3.3.2",
28-
"tinycolor2": "^1.6.0",
2927
"tslib": "^2.8.1"
3028
},
29+
"peerDependencies": {
30+
"echarts": "^6.0.0",
31+
"tinycolor2": "^1.6.0"
32+
},
3133
"devDependencies": {
3234
"@custom-elements-manifest/analyzer": "^0.10.4",
3335
"@rollup/plugin-replace": "^6.0.2",

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'))
77
export default defineConfig({
88
server: { open: '/demo/', port: 8000 },
99
resolve: { alias: { tslib: 'tslib/tslib.es6.js' } },
10-
optimizeDeps: { include: ['echarts', 'zrender', 'tslib', 'tinycolor2'] },
10+
optimizeDeps: { exclude: ['echarts', 'tinycolor2'] },
1111
define: { 'process.env.NODE_ENV': JSON.stringify('production') },
1212
plugins: [replace({ versionplaceholder: pkg.version, preventAssignment: true })],
1313
build: {
1414
lib: { entry: 'src/widget-linechart.ts', formats: ['es'], fileName: 'widget-linechart' },
1515
sourcemap: true,
1616
rollupOptions: {
17+
external: [/^echarts/, 'tinycolor2'],
1718
output: { banner: '/* @license Copyright (c) 2025 Record Evolution GmbH. All rights reserved.*/' }
1819
}
1920
}

0 commit comments

Comments
 (0)