babel-preset-current-node-syntax
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "babel-preset-current-node-syntax", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A Babel preset that enables parsing of proposals supported by the current Node.js version.", | ||
"main": "src/index.js", | ||
"repository": "https://github.com/nicolo-ribaudo/babel-preset-current-node-syntax", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/nicolo-ribaudo/babel-preset-current-node-syntax.git" | ||
}, | ||
"author": { | ||
@@ -11,2 +14,5 @@ "name": "Nicolò Ribaudo", | ||
}, | ||
"scripts": { | ||
"test": "node ./test/index.js" | ||
}, | ||
"dependencies": { | ||
@@ -16,2 +22,3 @@ "@babel/plugin-syntax-async-generators": "^7.8.4", | ||
"@babel/plugin-syntax-class-properties": "^7.8.3", | ||
"@babel/plugin-syntax-import-meta": "^7.8.3", | ||
"@babel/plugin-syntax-json-strings": "^7.8.3", | ||
@@ -18,0 +25,0 @@ "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", |
@@ -14,2 +14,3 @@ const tests = { | ||
"nullish-coalescing-operator": ["a ?? b"], // Babel 7.9.0 | ||
// import.meta is handled manually | ||
@@ -43,2 +44,11 @@ // Stage 3 | ||
// import.meta is only allowed in modules, and modules can only be evaluated | ||
// synchronously. For this reason, we cannot detect import.meta support at | ||
// runtime. It is supported starting from 10.4, so we can check the version. | ||
const major = parseInt(process.versions.node, 10); | ||
const minor = parseInt(process.versions.node.match(/^\d+\.(\d+)/)[1], 10); | ||
if (major > 10 || (major === 10 && minor > 4)) { | ||
plugins.push(require.resolve("@babel/plugin-syntax-import-meta")); | ||
} | ||
module.exports = () => ({ plugins }); |
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
4847
45
1
12
+ Added@babel/plugin-syntax-import-meta@7.10.4(transitive)