gulp-aegean

0.2.0 • Public • Published

gulp-aegean

Gulp plugin for aegean (ES6 inline import).

npm NpmLicense Known Vulnerabilities

const gulp = require('gulp');
const aegean = require('gulp-aegean');
 
gulp.task('js', function() {
  return gulp.src('src/**/*.js')
    .pipe(aegean())
    .pipe(gulp.dest('dist'));
});

Summary

Installation

With npm:

npm install --save-dev gulp-aegean

With yarn:

yarn add --dev gulp-aegean

Usage

Example 1: simple usage

src/main.js

import "./echo";
import "./is_string";
 
const input = "hello world";
 
if(is_string(input) === true) {
  echo(input);
}

gulpfile.js

const gulp = require('gulp');
const aegean = require('gulp-aegean');
 
gulp.task('js', function() {
  return gulp.src('src/**/*.js')
    .pipe(aegean())
    .pipe(gulp.dest('dist'));
});

Result:

dist/main.js

function echo(mixed) {
  console.log(mixed);
}
 
function is_string(mixed) {
  return (
    mixed !== null && mixed !== undefined && mixed.constructor === String
  );
}
 
 
const input = "hello world";
 
if (is_string(input) === true) {
  echo(input);
}

Package Sidebar

Install

npm i gulp-aegean

Weekly Downloads

38

Version

0.2.0

License

MIT

Unpacked Size

100 kB

Total Files

11

Last publish

Collaborators

  • khalyomede