Skip to content

Commit

Permalink
chore: get node version used in transforms from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 13, 2021
1 parent 9aeaf24 commit 637249b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion babel.config.js
@@ -1,11 +1,16 @@
'use strict';

const semver = require('semver');
const pkg = require('./package.json');

const supportedNodeVersion = semver.minVersion(pkg.engines.node).version;

// todo: https://github.com/babel/babel/issues/8529 :'(
module.exports = {
plugins: ['replace-ts-export-assignment'],
presets: [
'@babel/preset-typescript',
['@babel/preset-env', { targets: { node: 10 } }],
['@babel/preset-env', { targets: { node: supportedNodeVersion } }],
],
ignore: ['src/**/__tests__/fixtures/**'],
};
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -118,6 +118,7 @@
"resolve-from": "^5.0.0",
"rimraf": "^3.0.0",
"semantic-release": "^17.0.7",
"semver": "^7.3.5",
"ts-node": "^9.0.0",
"typescript": "^4.4.0"
},
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Expand Up @@ -4544,6 +4544,7 @@ __metadata:
resolve-from: ^5.0.0
rimraf: ^3.0.0
semantic-release: ^17.0.7
semver: ^7.3.5
ts-node: ^9.0.0
typescript: ^4.4.0
peerDependencies:
Expand Down

0 comments on commit 637249b

Please sign in to comment.