2023-04-28 05:44:27 +00:00
|
|
|
import path from 'path';
|
2023-12-28 13:03:21 +00:00
|
|
|
import type { UserConfig } from 'vite';
|
2023-05-12 07:48:20 +00:00
|
|
|
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
|
2023-12-28 13:03:21 +00:00
|
|
|
import dts from 'vite-plugin-dts';
|
|
|
|
|
2023-12-31 03:21:28 +00:00
|
|
|
import { commonPlugins } from './common.mjs';
|
2023-04-28 05:44:27 +00:00
|
|
|
|
|
|
|
export const packageConfig: UserConfig = {
|
2023-04-28 11:46:58 +00:00
|
|
|
base: './',
|
2023-04-28 05:44:27 +00:00
|
|
|
plugins: [
|
2023-06-26 01:53:54 +00:00
|
|
|
...commonPlugins,
|
2023-04-28 05:44:27 +00:00
|
|
|
dts({
|
|
|
|
insertTypesEntry: true,
|
|
|
|
}),
|
2023-05-12 07:48:20 +00:00
|
|
|
cssInjectedByJsPlugin(),
|
2023-04-28 05:44:27 +00:00
|
|
|
],
|
|
|
|
build: {
|
2023-05-12 07:48:20 +00:00
|
|
|
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: {
|
2024-01-29 18:13:09 +00:00
|
|
|
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',
|
2023-05-12 07:48:20 +00:00
|
|
|
'@emotion/react': 'EmotionReact',
|
2024-01-29 18:13:09 +00:00
|
|
|
'@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
|
|
|
};
|