forked from owncloud/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.cern.config.ts
36 lines (30 loc) · 1.14 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 { 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
}
// collapsible table
config.resolve.alias['design-system/src/components/OcTable/OcTable.vue'] = join(
projectRootDir,
'packages/web-pkg/src/cern/components/CollapsibleOcTable.vue'
)
// token info request
config.resolve.alias['web-runtime/src/composables/tokenInfo'] = join(
projectRootDir,
'packages/web-pkg/src/cern/composables/useLoadTokenInfo'
)
config.plugins.push(historyModePlugins()[0])
return config
})