-
Notifications
You must be signed in to change notification settings - Fork 5
/
vite.config.js
49 lines (46 loc) · 1008 Bytes
/
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
import * as childProcess from 'child_process';
import * as path from 'path';
import createVuePlugin from '@vitejs/plugin-vue';
import envCompatible from 'vite-plugin-env-compatible';
process.env.VUE_APP_BUILD_TIME = Date.now();
process.env.VUE_APP_GIT_COMMIT = childProcess.execSync( 'git rev-parse HEAD' ).toString().trim();
const base = ( process.env.NODE_ENV === 'production' ) ? '/querybuilder/' : '/';
export default {
base,
plugins: [
createVuePlugin(),
envCompatible(),
],
resolve: {
alias: [
{
find: '@',
replacement: path.resolve( __dirname, './src' ),
},
],
},
server: {
host: '0.0.0.0',
},
build: {
commonjsOptions: {
ignoreDynamicRequires: true,
},
},
css: {
preprocessorOptions: {
scss: {
// @use 'sass:math' is for WikitPopover component
additionalData: `
@use 'sass:math';
@import '@wikimedia/codex-design-tokens/theme-wikimedia-ui';
`,
},
},
postcss: {
plugins: [
require( 'autoprefixer' ),
],
},
},
};