InvokeAI/invokeai/frontend/web/config/vite.package.config.mts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-04-28 05:44:27 +00:00
import path from 'path';
import type { UserConfig } from 'vite';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
import dts from 'vite-plugin-dts';
import { commonPlugins } from './common.mjs';
2023-04-28 05:44:27 +00:00
export const packageConfig: UserConfig = {
base: './',
2023-04-28 05:44:27 +00:00
plugins: [
...commonPlugins,
2023-04-28 05:44:27 +00:00
dts({
insertTypesEntry: true,
}),
cssInjectedByJsPlugin(),
2023-04-28 05:44:27 +00:00
],
build: {
cssCodeSplit: true,
2023-04-28 05:44:27 +00:00
lib: {
entry: path.resolve(__dirname, '../src/index.ts'),
name: 'InvokeAIUI',
fileName: (format) => `invoke-ai-ui.${format}.js`,
},
rollupOptions: {
external: ['react', 'react-dom', '@emotion/react', '@chakra-ui/react', '@invoke-ai/ui-library'],
2023-04-28 05:44:27 +00:00
output: {
globals: {
react: 'React',
2023-04-28 11:25:25 +00:00
'react-dom': 'ReactDOM',
'@emotion/react': 'EmotionReact',
'@invoke-ai/ui-library': 'UiLibrary',
2023-04-28 05:44:27 +00:00
},
},
},
},
2023-04-28 11:25:25 +00:00
resolve: {
alias: {
app: path.resolve(__dirname, '../src/app'),
assets: path.resolve(__dirname, '../src/assets'),
common: path.resolve(__dirname, '../src/common'),
features: path.resolve(__dirname, '../src/features'),
services: path.resolve(__dirname, '../src/services'),
theme: path.resolve(__dirname, '../src/theme'),
},
},
2023-04-28 05:44:27 +00:00
};