Skip to content

Order in output CSS file #140

@mech-tools

Description

@mech-tools

Hello

Let's assume the following components :

// Vue DevTools would show :
<Root>
  <SubRoot>
    <EndOfTree>

// Component Root
<template>
  <div class=".root-css">
    <sub-root></sub-root>
  </div>
</template>
<script>
  import SubRoot from './SubRoot.vue'
  export default {
    name: 'Root',
    components: { SubRoot }
  }
</script>
<style>.root-css { background-color: blue }</style> // <--- CSS Specific to this component


// Component SubRoot
<template>
  <div class=".sub-root-css">
    <end-of-tree-css></end-of-tree-css>
  </div>
</template>
<script>
  import EndOfTree from './EndOfTree.vue'
  export default {
    name: 'SubRoot',
    components: { EndOfTree }
  }
</script>
<style>.sub-root-css { background-color: red }</style>  // <--- CSS Specific to this component


// Component EndOfTree
<template>
  <div class=".end-of-tree-css">EndOfTree</div>
</template>
<script>
  export default {
    name: 'EndOfTree',
  }
</script>
<style>.end-of-tree-css { background-color: green }</style>  // <--- CSS Specific to this component

The issue : the production build contains the extracted css of all components in the wrong order.

Output CSS file is :

  • EndOfTree CSS
  • SubRoot CSS
  • Root CSS

Desired ouput CSS file :

  • Root CSS
  • SubRoot CSS
  • EndOfTree CSS

This is especially annoying if I have some reset CSS on the root component.

Note : I use vuejs-templates/webpack and vuejs/vue-router

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions