Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Vueify.Next: vue.config.js not loaded #116

Closed
isotes opened this issue Aug 17, 2016 · 3 comments · Fixed by #146
Closed

Vueify.Next: vue.config.js not loaded #116

isotes opened this issue Aug 17, 2016 · 3 comments · Fixed by #146

Comments

@isotes
Copy link

isotes commented Aug 17, 2016

In the current 'next' version, vue.config.js is ignored (in my case used for a custom compiler).

It seems that loading the file has been removed in this commit:

98ec0b2#diff-168726dbe96b3ce427e7fedce31bb0bcL4

Is this a regression or is there a new mechanism for vue.config.js?

@whaaaley
Copy link

i think i'm having the same issue. i can't get autoprefixer to run at all.

@nopnop
Copy link

nopnop commented Sep 7, 2016

As a workaround, I suggest the use of a dedicated browserify transform, defined in the package.json browserify entry, that inherit from vueify.

(nb: Anyway, the previous resolver for vue.config.js was buggy as it was based on process.cwd() instead of the package's root as it would be expected for a browserified package).

package.json

//...
  "browserify": {
    "transform": [
      "./vue-transform.js",
      [ "babelify", { "presets": [ "es2015"  ] } ]
    ]
  },
//...

./vue-transform.js

const PassThrough = require('stream').PassThrough
const vueify = require('vueify')

// Define options (or use require('./vue.config.js') to define options)
const localOptions = {
  // ... any vue.config.js options...
  postcss: [require('postcss-import')()],
}

// Export a browserify transform for vueify, binded with your options
module.exports = function (file, options) {
  if (!/.vue$/.test(file)) {
    return new PassThrough()
  }
  options = Object.assign({}, localOptions, options)
  return vueify(file, options)
}

@isotes
Copy link
Author

isotes commented Sep 9, 2016

@nopnop Thanks for the workaround tip!

I'll leave this open as a reminder to adapt the README or the code.

AdamNiederer added a commit to AdamNiederer/vueify that referenced this issue Oct 10, 2016
yyx990803 pushed a commit that referenced this issue Dec 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants