【问题标题】:Change default vuetify-loader variables scss file path更改默认 vuetify-loader 变量 scss 文件路径
【发布时间】:2020-07-27 18:38:38
【问题描述】:

我使用 Vue CLI(支持 typescript)创建了一个项目,并使用 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.js vuetify.js vuetify-loader


    【解决方案1】:

    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

    repo 中已经有一个 open issue 用于跟踪任何更改。

    【讨论】:

      猜你喜欢
      • 2023-04-08
      • 1970-01-01
      • 2021-11-26
      • 1970-01-01
      • 1970-01-01
      • 2013-09-03
      • 1970-01-01
      • 2023-01-17
      • 2018-09-23
      相关资源
      最近更新 更多