vuejs / vueify

Browserify transform for single-file Vue components
MIT License
1.17k stars 153 forks source link

Import stylus plugins for all components #58

Open elclanrs opened 8 years ago

elclanrs commented 8 years ago

How can I import stylus plugins for all components? I understand I can do the following in each component:

<style lang="stylus" scoped>
  @import "nib"
  @import "jeet"
  // ...
</style>

But is there a way to import nib and jeet for all components? I tried in vue.config.js:

var nib = require('nib')
var jeet = require('jeet')

module.exports = {
  stylus: {
    use: [nib(), jeet()]
    import: ['nib', 'jeet']
  }
}

While use works (I can use the plugins importing them manually from each component), the imports don't work and I can't use any of the features provided by those plugins.

What am I missing?

chogarcia commented 8 years ago

Maybe you now it already but you added "scoped" attribute to limit CSS to the component only