mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
31 lines
738 B
TypeScript
31 lines
738 B
TypeScript
|
import { defineConfig } from 'vite';
|
||
|
|
||
|
export default defineConfig(({ mode }) => {
|
||
|
const __DEV__ = mode !== 'production';
|
||
|
|
||
|
return {
|
||
|
build: {
|
||
|
sourcemap: __DEV__,
|
||
|
lib: {
|
||
|
entry: './src/index.ts',
|
||
|
fileName: format => {
|
||
|
if (format === 'cjs') {
|
||
|
return 'commonjs/index.js';
|
||
|
}
|
||
|
return 'index.js';
|
||
|
},
|
||
|
// We use CommonJS output for running tests in jest.
|
||
|
formats: ['cjs', 'es'],
|
||
|
name: 'insomnia-components',
|
||
|
},
|
||
|
emptyOutDir: false,
|
||
|
rollupOptions: {
|
||
|
external: ['react', 'react-dom', 'styled-components', 'react-use'],
|
||
|
},
|
||
|
},
|
||
|
define: {
|
||
|
'process.env.NODE_ENV': JSON.stringify(mode),
|
||
|
},
|
||
|
};
|
||
|
});
|