mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
* first version of the pack * single entry point * add custom components to the package * move form components to toolkit * add more utils and hooks to the package * minor fixes * add CI workflow * update readme and package.json * fix ts * fix build of env-validator * fix docker build * fix icons size * test fixes * more test fixes
93 lines
2.2 KiB
TypeScript
93 lines
2.2 KiB
TypeScript
import react from '@vitejs/plugin-react';
|
|
import { resolve } from 'path';
|
|
import { defineConfig } from 'vite';
|
|
import dts from 'vite-plugin-dts';
|
|
import svgr from 'vite-plugin-svgr';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
tsconfigPaths(),
|
|
svgr({
|
|
include: '**/*.svg',
|
|
exclude: '',
|
|
svgrOptions: {
|
|
icon: true,
|
|
svgo: true,
|
|
plugins: [ '@svgr/plugin-jsx' ],
|
|
svgoConfig: {
|
|
plugins: [
|
|
{
|
|
name: 'preset-default',
|
|
params: {
|
|
overrides: {
|
|
removeViewBox: false,
|
|
removeHiddenElems: false,
|
|
},
|
|
},
|
|
},
|
|
'removeDimensions',
|
|
],
|
|
},
|
|
},
|
|
}),
|
|
dts({
|
|
include: [
|
|
'../chakra/**/*.tsx',
|
|
'../theme/**/*.ts',
|
|
'../components/**/*',
|
|
'../utils/**/*.ts',
|
|
'../hooks/**/*.tsx',
|
|
'./src/**/*.ts',
|
|
'../../global.d.ts',
|
|
'../../decs.d.ts',
|
|
'../../reset.d.ts',
|
|
],
|
|
rollupTypes: false,
|
|
outDir: './dist',
|
|
insertTypesEntry: true,
|
|
entryRoot: '..',
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
configs: resolve(__dirname, '../../configs'),
|
|
lib: resolve(__dirname, '../../lib'),
|
|
types: resolve(__dirname, '../../types'),
|
|
icons: resolve(__dirname, '../../icons'),
|
|
ui: resolve(__dirname, '../../ui'),
|
|
'public': resolve(__dirname, '../../public'),
|
|
toolkit: resolve(__dirname, '../'),
|
|
},
|
|
},
|
|
build: {
|
|
lib: {
|
|
entry: resolve(__dirname, './src/index.ts'),
|
|
formats: [ 'es' ],
|
|
fileName: 'index',
|
|
},
|
|
outDir: './dist',
|
|
rollupOptions: {
|
|
external: [
|
|
'react',
|
|
'react-dom',
|
|
'react/jsx-runtime',
|
|
'react/jsx-dev-runtime',
|
|
'@chakra-ui/react',
|
|
'@emotion/react',
|
|
'next/link',
|
|
'next/router',
|
|
'next-themes',
|
|
'react-hook-form',
|
|
],
|
|
output: {
|
|
preserveModules: false,
|
|
preserveModulesRoot: '..',
|
|
exports: 'named',
|
|
interop: 'auto',
|
|
},
|
|
},
|
|
},
|
|
});
|