-
Notifications
You must be signed in to change notification settings - Fork 157
/
vite.cern.config.ts
36 lines (29 loc) · 1.05 KB
/
vite.cern.config.ts
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
import { PluginOption, defineConfig, searchForWorkspaceRoot } from 'vite'
import _defineConfig, { historyModePlugins } from './vite.config'
import { join } from 'path'
/**
* NOTE: This is a special config file for CERN. It overwrites some of the code paths to implement custom logic
* that only applies to CERN. It can and should be ignored in all other cases!
*
* Web can be run using this config via `pnpm build:w -c vite.cern.config.ts` or `pnpm vite -c vite.cern.config.ts`.
*/
const projectRootDir = searchForWorkspaceRoot(process.cwd())
export default defineConfig(async (args) => {
let config
if (typeof _defineConfig === 'function') {
config = await _defineConfig(args)
} else {
config = _defineConfig
}
config.server = {
port: 9201,
strictPort: true
}
// create space component
;(config.resolve.alias as any)['../../components/AppBar/CreateSpace.vue'] = join(
projectRootDir,
'packages/web-pkg/src/cern/components/CreateSpace.vue'
)
config.plugins.push(historyModePlugins()[0] as PluginOption)
return config
})