File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ export type ImportPluginOptions =
22
22
23
23
export { generateImports } from './imports/generateImports'
24
24
25
- export function resolveVuetifyBase ( ) {
26
- return path . dirname ( require . resolve ( 'vuetify/package.json' , { paths : [ process . cwd ( ) ] } ) )
25
+ export function resolveVuetifyBase ( root ?: string ) {
26
+ const paths = ( root && root != process . cwd ( ) ) ? [ root ] : [ ]
27
+ paths . push ( process . cwd ( ) )
28
+ return path . dirname ( require . resolve ( 'vuetify/package.json' , { paths } ) )
27
29
}
28
30
29
31
export function isObject ( value : any ) : value is object {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function isSubdir (root: string, test: string) {
10
10
}
11
11
12
12
export function stylesPlugin ( options : Options ) : Plugin {
13
- const vuetifyBase = resolveVuetifyBase ( )
13
+ let vuetifyBase : string
14
14
15
15
let configFile : string
16
16
const tempFiles = new Map < string , string > ( )
@@ -19,11 +19,13 @@ export function stylesPlugin (options: Options): Plugin {
19
19
name : 'vuetify:styles' ,
20
20
enforce : 'pre' ,
21
21
configResolved ( config ) {
22
+ const root = config . root || process . cwd ( ) ;
23
+ vuetifyBase = resolveVuetifyBase ( root )
22
24
if ( isObject ( options . styles ) ) {
23
25
if ( path . isAbsolute ( options . styles . configFile ) ) {
24
26
configFile = options . styles . configFile
25
27
} else {
26
- configFile = path . join ( config . root || process . cwd ( ) , options . styles . configFile )
28
+ configFile = path . join ( root , options . styles . configFile )
27
29
}
28
30
}
29
31
} ,
You can’t perform that action at this time.
0 commit comments