Skip to content

Commit 3e36fd2

Browse files
committed
Updated babel configuration. Added jsnext:main
1 parent cd65202 commit 3e36fd2

File tree

5 files changed

+210
-391
lines changed

5 files changed

+210
-391
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules/
22
build/
33
.DS_Store
44
test_build/
5+
.tern-port

gulpfile.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ const testPath = './test/**/*.spec.js';
1111
const libPath = './src/**/*.js';
1212
const buildPath = './build/**/*.js';
1313

14+
const babelConfig = {
15+
"plugins": [
16+
"transform-es2015-classes",
17+
"transform-es2015-destructuring",
18+
"transform-es2015-modules-commonjs",
19+
"transform-es2015-object-super",
20+
"transform-es2015-parameters",
21+
"transform-es2015-shorthand-properties",
22+
"transform-es2015-spread",
23+
"transform-es2015-unicode-regex",
24+
"transform-flow-strip-types",
25+
"syntax-flow"
26+
]
27+
};
28+
1429
gulp.task('remove_flow', function() {
1530
return gulp.src([libPath])
1631
.pipe(babel({
@@ -28,10 +43,8 @@ gulp.task('rollup', ['remove_flow'], function() {
2843

2944
gulp.task('babel', ['rollup'], function() {
3045
return gulp.src('./lib/index.js')
31-
.pipe(sourcemaps.init())
32-
.pipe(babel({
33-
"presets": ["es2015", "react", "stage-0"]
34-
}))
46+
.pipe(sourcemaps.init())
47+
.pipe(babel(babelConfig))
3548
.pipe(sourcemaps.write())
3649
.pipe(rename("processes.js"))
3750
.pipe(gulp.dest('./lib'));
@@ -44,18 +57,16 @@ gulp.task('build', ['babel'], function() {
4457

4558
gulp.task('build_test', function() {
4659
return gulp.src([testPath])
47-
.pipe(sourcemaps.init())
48-
.pipe(babel({
49-
"presets": ["es2015", "react", "stage-0"]
50-
}))
60+
.pipe(sourcemaps.init())
61+
.pipe(babel(babelConfig))
5162
.pipe(sourcemaps.write())
5263
.pipe(gulp.dest('./test_build'));
5364
});
5465

5566
gulp.task('lint', function () {
5667
return gulp.src([libPath, testPath])
5768
.pipe(eslint())
58-
.pipe(eslint.format())
69+
.pipe(eslint.format());
5970
});
6071

6172
gulp.task('test', ['lint', 'build', 'build_test'], function () {

0 commit comments

Comments
 (0)