How can I use Elixir + Vueify?

1.1k views Asked by At

How can I use Elixir + Vueify like the Vue-Hackernews sample?

They use some command like this at the package.json

....
"scripts": {
    "dev": "watchify -v -t vueify -e src/main.js -o build/build.js",
    "build": "./node_modules/watchify/node_modules/.bin/browserify -t vueify src/main.js | uglifyjs -c -m > build/build.js"
}
...

But I do not know how to use it with Laravel Elixir

Sample

1

There are 1 answers

1
Daniel Kuroski On BEST ANSWER
  1. Install sudo npm install laravel-elixir-browserify vue vueify --save
  2. In your gulpfile.js add the following:

    var elixir = require('laravel-elixir');
    
    var vueify = require('laravel-elixir-browserify').init("vueify");
    
    elixir(function(mix) {
        // resources/assets/js/main.js
        mix.vueify('main.js', {insertGlobals: true, transform: "vueify", output: "public/js"});
    });
    
  3. Be Happy =D

Laravel Elixir Browserify Extension Doc Click Here