@@ -5,15 +5,15 @@ import { readFile } from 'node:fs/promises'
5
5
const VUESTIC_CONFIG_ALIAS = '#vuestic-config'
6
6
7
7
export const resolveVuesticConfigPath = ( ) => {
8
- if ( existsSync ( 'vuestic.config.ts' ) ) {
8
+ if ( existsSync ( './ vuestic.config.ts' ) ) {
9
9
return './vuestic.config.ts'
10
- } else if ( existsSync ( 'vuestic.config.js' ) ) {
10
+ } else if ( existsSync ( './ vuestic.config.js' ) ) {
11
11
return './vuestic.config.js'
12
- } else if ( existsSync ( 'vuestic.config.mjs' ) ) {
12
+ } else if ( existsSync ( './ vuestic.config.mjs' ) ) {
13
13
return './vuestic.config.mjs'
14
- } else if ( existsSync ( 'vuestic.config.cjs' ) ) {
14
+ } else if ( existsSync ( './ vuestic.config.cjs' ) ) {
15
15
return './vuestic.config.cjs'
16
- } else if ( existsSync ( 'vuestic.config.mts' ) ) {
16
+ } else if ( existsSync ( './ vuestic.config.mts' ) ) {
17
17
return './vuestic.config.mts'
18
18
} else {
19
19
return undefined
@@ -29,11 +29,11 @@ export const tryToReadConfig = async (path: string) => {
29
29
}
30
30
31
31
export const isConfigExists = ( configPath : string | undefined ) => {
32
- const path = configPath ?? resolveVuesticConfigPath ( )
33
-
34
- if ( ! path ) { return false }
32
+ if ( ! configPath ) {
33
+ return resolveVuesticConfigPath ( )
34
+ }
35
35
36
- return existsSync ( path )
36
+ return existsSync ( configPath )
37
37
}
38
38
39
39
/** This plugin is used to resolve path to vuestic config if it is imported with `#vuestic-config` */
@@ -47,7 +47,7 @@ export const configResolver = (options: {
47
47
// Resolve vuestic config alias
48
48
async resolveId ( source ) {
49
49
if ( source === VUESTIC_CONFIG_ALIAS ) {
50
- return `virtual:${ VUESTIC_CONFIG_ALIAS } `
50
+ return `virtual:vuestic-config `
51
51
}
52
52
} ,
53
53
@@ -56,7 +56,7 @@ export const configResolver = (options: {
56
56
configPath = resolveVuesticConfigPath ( )
57
57
} = options
58
58
59
- if ( id === `virtual:${ VUESTIC_CONFIG_ALIAS } ` ) {
59
+ if ( id === `virtual:vuestic-config ` ) {
60
60
if ( ! configPath ) {
61
61
return 'export default {}'
62
62
}
0 commit comments