碳设计系统全球scss需要永远建立

碳设计系统全球scss需要永远建立,css,vue.js,sass,carbon-design-system,Css,Vue.js,Sass,Carbon Design System,我正在尝试应用碳设计系统(Vue)的g10主题。但是每次我保存一个文件,编译大约需要12-15分钟 是否有方法仅为我使用的组件添加样式 如果没有,我如何减少构建时间 是否有一种方法可以删除scss文件上的监视,以便在使用Vue文件时节省编译时间 我们通过在App.vue文件中设置所有与碳相关的样式来解决这个问题,该文件导入另一个组件(例如AppContent.vue),其中包含整个应用程序的内容 这意味着仅当您更改App.vue时才编译Carbon样式,并且由于所有内容都在AppConten

我正在尝试应用碳设计系统(Vue)的g10主题。但是每次我保存一个文件,编译大约需要12-15分钟

  • 是否有方法仅为我使用的组件添加样式
  • 如果没有,我如何减少构建时间
  • 是否有一种方法可以删除scss文件上的监视,以便在使用Vue文件时节省编译时间

我们通过在
App.vue
文件中设置所有与碳相关的样式来解决这个问题,该文件导入另一个组件(例如
AppContent.vue
),其中包含整个应用程序的内容

这意味着仅当您更改
App.vue
时才编译Carbon样式,并且由于所有内容都在
AppContent.vue
中,因此您只需更改此文件,而无需更改
App.vue

App.vue

<template>
  <app-content></app-content>
</template>

<script>
import AppContent from "./AppContent.vue";
export default {
  components: { AppContent }
};
</script>

<style lang="scss">
@import "./styles/carbon";
@import "./styles/_carbon.scss";
</style>
<template>
  <!-- the rest of your app -->
</template>

<script>
  // the rest of your app
</script>

<style>
  /* the rest of your app */
</style>

我在app.vue中遇到错误。你是怎么解决的模块错误(来自./node_modules/eslint loader/index.js):错误:在src/App.vue:13:5:11 | name:“App”,12 | components:{>13 | content:content | ^14 | | 15 |;16 | ``我更新了我的回复,将
内容
更改为
AppContent
,我认为使用
内容
可能会把事情搞砸,并给你带来错误
<template>
  <!-- the rest of your app -->
</template>

<script>
  // the rest of your app
</script>

<style>
  /* the rest of your app */
</style>