Skip to content

Commit 7ded276

Browse files
author
Amir Tocker
committed
Setup library and tests to run with either es6 or es5
1 parent 3002c7f commit 7ded276

40 files changed

+4439
-96
lines changed

.babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
4+
["env", {
5+
"targets": {
6+
"node": "4"
7+
}
8+
}],
9+
"stage-0"
10+
],
11+
"plugins": []
12+
}

.travis.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
language: node_js
2-
node_js:
3-
- '4'
4-
- '6'
5-
- '8'
2+
nvm:
3+
4+
matrix:
5+
include:
6+
- node_js: "4"
7+
script: npm run test-es5
8+
- node_js: "6"
9+
script: npm run test-es5
10+
- node_js: "8"
11+
script: npm run test-es6
12+
- node_js: "10"
13+
script: npm run test-es6

babel.config.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
const presets = [
22
[
3-
"@babel/env",
3+
[
4+
"env",
5+
{
6+
targets: {node: "4"}
7+
}
8+
],
9+
"stage-0"
410
],
511
];
12+
const plugins = ["transform-object-rest-spread"];
613

7-
module.exports = { presets };
14+
module.exports = {presets, plugins};

cloudinary.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = process.versions.node[0] === '4' ? require('./lib-node4/cloudinary') : require('./lib/cloudinary');
1+
module.exports = Number(process.versions.node[0]) < 8 ? require('./lib-es5/cloudinary') : require('./lib/cloudinary');

0 commit comments

Comments
 (0)