-
Notifications
You must be signed in to change notification settings - Fork 178
/
vite.config.mts
69 lines (68 loc) · 1.83 KB
/
vite.config.mts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/// <reference types="vitest" />
/// <reference types="vite/client" />
import path from 'path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import postCssImport from 'postcss-import'
import postCssApply from 'postcss-apply'
import postColorModFunction from 'postcss-color-mod-function'
import postCssPresetEnv from 'postcss-preset-env'
import lostCss from 'lost'
export default defineConfig({
build: {
// Relative to the root
outDir: 'dist',
},
plugins: [
react({
include: '**/*.tsx',
babel: {
// Use babel.config.js files
configFile: true,
},
}),
],
optimizeDeps: {
esbuildOptions: {
target: 'es2020',
},
exclude: ['node_modules'],
},
css: {
postcss: {
plugins: [
postCssImport({ root: 'src/' }),
postCssApply(),
postColorModFunction(),
postCssPresetEnv({ stage: 0 }),
lostCss(),
],
},
},
define: {
'process.env': process.env,
global: 'globalThis',
},
resolve: {
alias: {
'@opentrons/components/styles': path.resolve(
'./components/src/index.module.css'
),
'@opentrons/components': path.resolve('./components/src/index.ts'),
'@opentrons/shared-data/pipette/fixtures/name': path.resolve(
'./shared-data/pipette/fixtures/name/index.ts'
),
'@opentrons/shared-data/labware/fixtures/1': path.resolve(
'./shared-data/labware/fixtures/1/index.ts'
),
'@opentrons/shared-data/labware/fixtures/2': path.resolve(
'./shared-data/labware/fixtures/2/index.ts'
),
'@opentrons/shared-data': path.resolve('./shared-data/js/index.ts'),
'@opentrons/step-generation': path.resolve(
'./step-generation/src/index.ts'
),
'/app/': path.resolve('./app/src/') + '/',
},
},
})