Skip to content

Commit

Permalink
Setup library and tests to run with either es6 or es5
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Tocker committed Nov 8, 2018
1 parent 3002c7f commit 7ded276
Show file tree
Hide file tree
Showing 40 changed files with 4,439 additions and 96 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [

["env", {
"targets": {
"node": "4"
}
}],
"stage-0"
],
"plugins": []
}
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
language: node_js
node_js:
- '4'
- '6'
- '8'
nvm:

matrix:
include:
- node_js: "4"
script: npm run test-es5
- node_js: "6"
script: npm run test-es5
- node_js: "8"
script: npm run test-es6
- node_js: "10"
script: npm run test-es6
11 changes: 9 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
const presets = [
[
"@babel/env",
[
"env",
{
targets: {node: "4"}
}
],
"stage-0"
],
];
const plugins = ["transform-object-rest-spread"];

module.exports = { presets };
module.exports = {presets, plugins};
2 changes: 1 addition & 1 deletion cloudinary.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = process.versions.node[0] === '4' ? require('./lib-node4/cloudinary') : require('./lib/cloudinary');
module.exports = Number(process.versions.node[0]) < 8 ? require('./lib-es5/cloudinary') : require('./lib/cloudinary');
Loading

0 comments on commit 7ded276

Please sign in to comment.