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 =
2222
2323export { generateImports } from './imports/generateImports'
2424
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 } ) )
2729}
2830
2931export 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) {
1010}
1111
1212export function stylesPlugin ( options : Options ) : Plugin {
13- const vuetifyBase = resolveVuetifyBase ( )
13+ let vuetifyBase : string
1414
1515 let configFile : string
1616 const tempFiles = new Map < string , string > ( )
@@ -19,11 +19,13 @@ export function stylesPlugin (options: Options): Plugin {
1919 name : 'vuetify:styles' ,
2020 enforce : 'pre' ,
2121 configResolved ( config ) {
22+ const root = config . root || process . cwd ( ) ;
23+ vuetifyBase = resolveVuetifyBase ( root )
2224 if ( isObject ( options . styles ) ) {
2325 if ( path . isAbsolute ( options . styles . configFile ) ) {
2426 configFile = options . styles . configFile
2527 } else {
26- configFile = path . join ( config . root || process . cwd ( ) , options . styles . configFile )
28+ configFile = path . join ( root , options . styles . configFile )
2729 }
2830 }
2931 } ,
You can’t perform that action at this time.
0 commit comments