更改默认的 vuetify-loader 变量 scss 文件路径

Change default vuetify-loader variables scss file path

我使用 Vue CLI(支持打字稿)创建了一个项目,并使用 vue add vuetify

添加了 Vuetify

这会创建一个像这样的文件树:

project
 - public
 - node_modules
 - src
   - components
   - scss
     variables.scss
   - assets
   main.ts

但是,我想更改此结构以使用类似 Clean Architecture 的东西。所以,我有

project
 - public
 - node_modules
 - src
   - application
   - domain
   - infrastructure
   - web
     - components
     - assets
     - scss
       variables.scss
     main.ts

但是如果我这样做,vuetify-loader 将不再加载我的 variables.scss 文件。根据文档,它看起来只加载路径 src/scss/variables.scss

有没有办法将默认路径更改为 src/web/scss/variables.scss

vue-cli-plugin-vuetify 似乎被硬编码为期望结构:

for (const ext of ['sass', 'scss']) {
    const path = `${folder}/${file}.${ext}`

    // If file doesn't exist in user
    // project, continue to next
    if (!fileExists(api, `src/${path}`)) continue

    // If file exists, push it into
    // the import statement
    data.push(`@import '@/${path}${end}`)
  }

Source

回购中已经有一个 open issue 来跟踪任何更改。