init from https://github.com/Hufe921/canvas-editor
This commit is contained in:
commit
977ba1c283
456 files changed
+52892
No files matched your search
@@ -0,0 +1,46 @@
|
||||
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: `/${name}/`,
|
||||
server: {
|
||||
host: '0.0.0.0'
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user