0.2.0 • Published 6 years ago

gulp-aegean v0.2.0

Weekly downloads
16
License
MIT
Repository
github
Last release
6 years ago

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);
}
0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago