vuejs / vueify

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

Can vueify handle the case where it gets applied twice? #148

Open mediafreakch opened 8 years ago

mediafreakch commented 8 years ago

There is a nasty bug in browserify that causes transforms to be applied twice.

Imagine a scenario where you want to pass some options to vueify specific to unit tests, but not when the component is required by another one:

//package.json
"browserify": {
    "transform": [
      "vueify"
    ]
 } 
// karma.conf.js
browserify: {
      transform: [ ['vueify', { less: { paths: [ './spec/support' ] } }] ]
}

Due to the browserify bug the transform runs twice and breakes the generated JS code.

Is there a way for vueify to prevent that? if (!/.vue$/.test(file)) doesn't do it...