简体   繁体   中英

How can I use Elixir + Vueify?

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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM