You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
513 B
24 lines
513 B
import { defineConfig, UserConfig } from 'vite'
|
|
import * as path from 'path'
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const name = 'canvas-editor'
|
|
const defaultOptions: UserConfig = {
|
|
base: `/${name}/`
|
|
}
|
|
if (mode === 'lib') {
|
|
return {
|
|
...defaultOptions,
|
|
build: {
|
|
lib: {
|
|
name,
|
|
fileName: (format) => `${name}.${format}.js`,
|
|
entry: path.resolve(__dirname, 'src/editor/index.ts')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
...defaultOptions
|
|
}
|
|
}) |