gulp-vueify2

Compile .vue files using vueify, with Vue2 and extractCSS support
2,714 13
Install
npm install gulp-vueify2
Latest Version:0.0.3
Vue:2
License:MIT
Last Updated:Mar 23, 2017
Links: GitHub  ·  npm
Maintainer: cobaltway

gulp-vueify2

Compile *.vue component files using vueify without Browserify. Can be usefull for Electron app and server-side rendering (I wrote it primarily for the second case).

Use code from the package gulp-vueify, written by Zahajki, which seems abandoned. Main differences with the mentionned package are support for Vue2 and out of the box CSS extraction.

Installation

npm install gulp-vueify2 --save-dev

If you want to keep the CSS inline (won't work for server-side rendering), you also may have to do:

npm install vueify-insert-css babel-core babel-plugin-transform-runtime babel-preset-es2015 --save-dev

Usage

var vueify = require('gulp-vueify2');

gulp.task('vueify', function () {
  return gulp.src('components/**/*.vue')
    .pipe(vueify(options))
    .pipe(gulp.dest('./dist'));
});

Options for vueify are listed there.

I added one, CSSOut to specify the output of the style content, if extractCSS is set to true (ignored otherwise). Value can be a string (path to an output file), or a function that will be called for each component with the path of the component and the corresponding style.

With an output file

gulp.task('vueify', function () {
  return gulp.src('components/**/*.vue')
    .pipe(vueify({
        extractCSS: true,
        CSSOut: "./foo/bundle.css"
    }))
    .pipe(gulp.dest('./dist'));
});

With a function

gulp.task('vueify', function () {
  return gulp.src('components/**/*.vue')
    .pipe(vueify({
        extractCSS: true,
        CSSOut: function(file, style) {
            // file = full path of the .vue component file
            // style = a css string
        }
    }))
    .pipe(gulp.dest('./dist'));
});

Related Packages

gulp-vueify

Compile .vue files using vueify

9,069 33
omi-vueify

Bridge between omi and vue

31,156 13,277
vue-typescript-import-dts

TypeScript declaration file that allows using 'import' with *.vue files

21,718 27
laravel-elixir-vueify

Laravel Elixir Vueify Support

17,206 153
grunt-vueify

Translate `.vue` files to pure JavaScript, without using Browserify.

3,579 10

Version History

Version Released License
0.0.3 MIT
0.0.2 MIT
0.0.1 MIT