├── .gitignore
├── source
└── js
│ ├── main.js
│ └── module.js
├── dist
├── index.html
└── js
│ └── main.js
├── README.md
├── package.json
├── gulpfile.js
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .sass-cache
3 | node_modules
--------------------------------------------------------------------------------
/source/js/main.js:
--------------------------------------------------------------------------------
1 | import {moduleTest} from './module';
2 |
3 | let test = new moduleTest();
4 |
5 | test.showConsoleLog();
--------------------------------------------------------------------------------
/source/js/module.js:
--------------------------------------------------------------------------------
1 | export class moduleTest {
2 | constructor() {
3 | }
4 |
5 | showConsoleLog() {
6 | console.log("ES6 module test!");
7 | }
8 | }
--------------------------------------------------------------------------------
/dist/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | title
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Gulp babel codebase
2 | ==================
3 | A basic [gulp](https://github.com/gulpjs/gulp) codebase project using [babelify](https://github.com/babel/babelify) and [browserify](https://www.npmjs.com/package/browserify) for its modules.
4 |
5 | ### Getting started
6 | 1. `npm install`
7 | 2. `gulp`
8 |
9 | ## License
10 | MIT Copyright (c) [Juan Cabrera](http://juan.me)
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gulp-babel-codebase",
3 | "description": "A basic gulp codebase project using babelify and browserify for its modules.",
4 | "private": true,
5 | "version": "0.0.2",
6 | "author": "Juan Cabrera",
7 | "devDependencies": {
8 | "babelify": "^6.1.1",
9 | "browserify": "^10.2.0",
10 | "gulp": "^3.8.11",
11 | "gulp-connect": "^2.2.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var
4 | fs = require("fs"),
5 | gulp = require('gulp'),
6 | connect = require('gulp-connect'),
7 | browserify = require("browserify"),
8 | babelify = require("babelify")
9 | ;
10 |
11 | gulp.task('babelify', function() {
12 | browserify('./source/js/main.js', { debug: false })
13 | .transform(babelify)
14 | .bundle()
15 | .on("error", function (err) { console.log("Error : " + err.message); })
16 | .pipe(fs.createWriteStream("./dist/js/main.js"));
17 | });
18 |
19 | gulp.task('connect', function() {
20 | connect.server();
21 | });
22 |
23 | gulp.task('watch', function() {
24 | gulp.watch('./source/js/*.js', ['babelify']);
25 | });
26 |
27 | gulp.task('default', ['connect', 'watch']);
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) Juan Cabrera (juan.me)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining
6 | a copy of this software and associated documentation files (the
7 | "Software"), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be
14 | included in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
--------------------------------------------------------------------------------
/dist/js/main.js:
--------------------------------------------------------------------------------
1 | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o