-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
56 lines (47 loc) · 1.38 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
import { defineConfig } from 'vite'
import path from 'path'
import AutoImport from 'unplugin-auto-import/dist/vite.cjs'
export default defineConfig({
root: './src',
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@assets': path.resolve(__dirname, './src/assets'),
'@scss': path.resolve(__dirname, './src/scss'),
'@ts': path.resolve(__dirname, './src/ts'),
},
},
assetsInclude: ['./src/assets/**/*.*'],
build: {
emptyOutDir: true,
outDir: '../dist',
rollupOptions: {
output: {
entryFileNames: `[name].js`,
assetFileNames: `[name].[ext]`,
},
},
},
plugins: [
AutoImport({
dts: true, // or a custom path
include: [/\.[tj]s?$/], // only .ts and .js files
imports: [
// auto import helper function
{ '@ts/helper/array-access.helper.ts': ['ArrayAccess'] },
{
'@ts/helper/device-detection.helper.ts': [
'DeviceDetection',
],
},
{ '@ts/helper/dom.helper.ts': ['Dom'] },
{ '@ts/helper/formatting.helper.ts': ['Formatting'] },
{ '@ts/helper/selector.helper.ts': ['Selector'] },
{ '@ts/helper/utilities.helper.ts': ['Utilities'] },
// auto import vendor modules
{ '@ts/vendor/bootstrap/bootstrap.ts': ['bootstrap'] },
],
eslintrc: { enabled: true },
}),
],
})