-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
24 lines (22 loc) · 912 Bytes
/
vite.config.ts
File metadata and controls
24 lines (22 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { defineConfig } from 'vite'
import { readFileSync } from 'fs'
import replace from '@rollup/plugin-replace'
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'))
export default defineConfig({
server: { open: '/demo/', port: 8000 },
resolve: {
conditions: ['browser'],
alias: { tslib: 'tslib/tslib.es6.js' }
},
optimizeDeps: { exclude: ['echarts', 'tinycolor2'] },
define: { 'process.env.NODE_ENV': JSON.stringify('production') },
plugins: [replace({ versionplaceholder: pkg.version, preventAssignment: true })],
build: {
lib: { entry: 'src/widget-linechart.ts', formats: ['es'], fileName: 'widget-linechart' },
sourcemap: true,
rollupOptions: {
external: [/^echarts/, 'tinycolor2'],
output: { banner: '/* @license Copyright (c) 2026 Record Evolution GmbH. All rights reserved.*/' }
}
}
})