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

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,


1 Like

See the docs:


Thanks a lot! it is working well!

Thank you for your helpful question