Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit 7e7608a

Browse files
fix(#287): inject the correct path based on vuetify version.
1 parent cbd836a commit 7e7608a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/vue-cli-plugin-vuetify/util/helpers.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ function fileExists (api, file) {
3232
return fs.existsSync(api.resolve(file))
3333
}
3434

35+
// Returns the correct path for styles based on the Vuetify version
36+
function getStylesPath (end) {
37+
let vuetifyVersion
38+
39+
try {
40+
vuetifyVersion = semver.major(require('vuetify/package.json').version)
41+
} catch (e) {}
42+
43+
return vuetifyVersion === 3
44+
? `@import '~vuetify/lib/styles/styles.sass${end}`
45+
: `@import '~vuetify/src/styles/styles.sass${end}`
46+
}
47+
3548
// Create an import statement
3649
// to bootstrap a users variables
3750
function mergeRules (api, opt, ext) {
@@ -44,7 +57,7 @@ function mergeRules (api, opt, ext) {
4457
if (!data.length) return opt
4558

4659
// Inject Vuetify styles at the end of user supplied
47-
data.push(`@import '~vuetify/src/styles/styles.sass${end}`)
60+
data.push(getStylesPath(end))
4861

4962
let sassLoaderVersion
5063
try {

0 commit comments

Comments
 (0)