-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
67 lines (63 loc) · 1.89 KB
/
vite.config.js
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
/* Vite configuration used to compile assets for Storyboard. */
import path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
paths: [
path.resolve(__dirname, 'src'),
],
modifyVars: {
'ink-path': path.resolve(__dirname, 'src', 'ink'),
'tabler-path': path.resolve(__dirname, 'node_modules',
'\\@tabler', 'icons'),
},
},
},
},
optimizeDeps: {
esbuildOptions: {
target: 'esnext',
},
},
esbuild: {
target: "esnext",
},
build: {
target: "esnext",
},
plugins: [
react({
babel: {
/*
* This is strictly a subset of the plugins we use when
* building Ink through `npm run build`. We only want the
* ones we need for certain transforms and executions
* within the context of a Storybook Preview page.
* Anything else could lead to breakages.
*/
plugins: [
'@babel/plugin-external-helpers',
['@babel/plugin-proposal-decorators', {
'version': 'legacy'
}],
'babel-plugin-dedent',
'babel-plugin-django-gettext',
]
},
/*
* Limit this to our own code, so we don't run Storybook
* through it.
*/
include: /src\/.*\.(js|jsx|ts|tsx)$/,
}),
],
ssr: {
noExternal: [
'@beanbag/spina',
],
}
});