How to import global less file instead of importing in every single component?

Hello,
I am using vue-cli-plugin-iview in my project.

I have iview-variables.less file imported in plugins/iview.js.

Now I am using less variables in most of the components.

And I need to import iview-variables.less in every single component like this:

@import '~@/iview-variables.less';

I think there is should be other way to do this.
My components are more than 30.

Best regards,

Mudin

1 Like

See the docs:

https://cli.vuejs.org/guide/css.html#automatic-imports

2 Likes

Thanks a lot! it is working well!

Thank you for your helpful question