Skip to content

Commit

Permalink
2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gchudnov committed Feb 23, 2017
1 parent 772a045 commit 020c278
Show file tree
Hide file tree
Showing 27 changed files with 3,594 additions and 6,796 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.1.0
- Updated dependencies.
- Migrated code to ES6

## 2.0.2
- Updated dependencies.
- Fixed missing /dist directory.
Expand Down
7 changes: 7 additions & 0 deletions babel-settings.json
@@ -0,0 +1,7 @@
{
"babelrc": false,
"plugins": [
"transform-es2015-modules-commonjs",
["transform-object-rest-spread", { "useBuiltIns": true }]
]
}
68 changes: 68 additions & 0 deletions build/browserify.js
@@ -0,0 +1,68 @@
import gulp from 'gulp';
import header from 'gulp-header';
import uglify from 'gulp-uglify';
import gulpIf from 'gulp-if';
import browserify from 'browserify';
import babelify from 'babelify';
import source from 'vinyl-source-stream2';
import pkg from '../package.json';

const banner = [
'/*',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @author <%= pkg.author %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
''].join('\n');

function handleErrors(...args) {
console.error(args);
this.emit('end'); // Keep gulp from hanging on this task
}

gulp.task('script', () => {

const isProduction = (process.env.NODE_ENV === 'production');

const bundleConfig = {
name: 'inkjet',
entries: [`./index.js`], // require.resolve('babel-polyfill'),
dest: './dist',
outputName: `inkjet${isProduction ? '.min' : ''}.js`,
isUglify: isProduction,
};

let bundler = browserify({
entries: bundleConfig.entries,
insertGlobals: false,
detectGlobals: true,
standalone: bundleConfig.name,
debug: false
});

let bundle = () => {
return bundler
.bundle()
.on('error', handleErrors)
.pipe(source(bundleConfig.outputName))
.pipe(header(banner, { pkg: pkg }))
.pipe(gulpIf(bundleConfig.isUglify, uglify()))
.pipe(gulp.dest(bundleConfig.dest))
};

bundler
.transform(babelify.configure({
"presets": [
["es2015"],
],
"plugins": [
"add-module-exports",
"transform-es2015-modules-commonjs",
]
}
));

bundle();
});

0 comments on commit 020c278

Please sign in to comment.