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.
 
 
 
 
 
 

50 lines
1.1 KiB

import { defineConfig } from 'vite'
import typescript from '@rollup/plugin-typescript'
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
import * as path from 'path'
export default defineConfig(({ mode }) => {
const name = 'canvas-editor'
if (mode === 'lib') {
return {
plugins: [
cssInjectedByJsPlugin({
styleId: `${name}-style`,
topExecutionPriority: true
}),
{
...typescript({
tsconfig: './tsconfig.json',
include: ['./src/editor/**']
}),
apply: 'build',
declaration: true,
declarationDir: 'types/',
rootDir: '/'
}
],
build: {
lib: {
name,
fileName: name,
entry: path.resolve(__dirname, 'src/editor/index.ts')
},
rollupOptions: {
output: {
sourcemap: true
}
}
}
}
}
return {
base: `./`,
server: {
host: '0.0.0.0'
},
build: {
outDir: '../../frontend/public/docx',
assetsDir: 'assets',
}
}
})