Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-vue-compiler

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-vue-compiler

Vue single file component compiler plugin for Gulp

  • 1.0.0-beta.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26
Maintainers
1
Weekly downloads
 
Created
Source

gulp-vue-compiler

This plugin compiles Vue single file components (SFC) to plain JavaScript.

Installation

npm install gulp-vue-compiler --save-dev

Any other plugin or dependency such as babel-core should be installed as well.

Usage

var vueCompiler = require('gulp-vue-compiler');

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

Implementation details and options

  • options.newExtension: Optionally modifies the output files extension to the new string.

  • v0: Vueify's API is used internally. Therefore, any valid option for Vueify is valid here as well. See Vueify options here. Additionally, options.ESModules boolean option is available for removing the closure that Vueify adds automatically (which breaks ES modules). Passing modules: false in Babel's env preset automatically activates this option.

  • v1: Uses vue-component-compiler internally (more info here). options.esModule (default true), options.parserConfig, options.templateCompilerConfig, options.babel. Beta release does not support style tags.

Examples

  • Compiling *.vue components to plain JavaScript using Babel and ES modules:
return gulp.src('components/**/*.vue')
  .pipe(vueCompiler({
    newExtension: 'js', // *.vue => *.js
    babel: {
      babelrc: false,
      presets: [
        ['env', {
          modules: false, // Keep ES modules in 'script' tag
          targets: {
            browsers: [ '> 1%', 'last 2 versions' ]
          }
        }],
        'stage-3'
      ]
    }
  }))
  .pipe(gulp.dest('./dist/'));

Keywords

FAQs

Package last updated on 26 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc