Home

Issue: 648

Importing file in style increases build time drasticaly

[issue link]

I’m new to vue and nuxt so please forgive me if I’m got it wrong.
I need the $theme override variable form vuetify in my component ( used in a layout ).
I separated this variable in it’s own file (‘css/theme.style’) so I don’t load the whole theme.
I did this:

<style lang="styl">
     @require "../css/theme.style"
     /*
        $theme := {
           primary:#ff7752   
       }
    */
     .my-class{
         background-color: rgba($theme.primary, 0.5);
     }
</style>

The build time for this piece of code is 7550ms.
If I comment the require line and uncomment the $theme assignment, build time is around 40ms.
Is it wrong to require variables in components? Is there another decent way to achieve this?
Thank you for your time.

This question is available on Nuxt.js community (#c567)