From 050737bb0e425eb5444c0f17281e5bdb79319430 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Fri, 27 Mar 2020 19:17:05 -0400 Subject: [PATCH] feat: introduce rollup-plugin-babel to maintain legacy node support This patch pipes the build process through babel, ensuring the resulting output can still be used in all of the environments supported by v1.x of esquery. --- .babelrc | 5 +++++ package.json | 6 +++--- rollup.config.js | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..95f66ec --- /dev/null +++ b/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "@babel/env" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 12f62b3..5f65304 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,9 @@ "query" ], "devDependencies": { + "@babel/core": "^7.9.0", + "@babel/preset-env": "7.8.7", + "rollup-plugin-babel": "^4.4.0", "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-json": "^4.0.2", "@rollup/plugin-node-resolve": "^7.1.1", @@ -65,9 +68,6 @@ "rollup-plugin-terser": "^5.2.0" }, "license": "BSD-3-Clause", - "engines": { - "node": ">=8.0" - }, "dependencies": { "estraverse": "^5.0.0" } diff --git a/rollup.config.js b/rollup.config.js index dedfb2d..44fdc25 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,6 +3,7 @@ import { terser } from 'rollup-plugin-terser'; import nodeResolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; +import babel from 'rollup-plugin-babel'; /** * @external RollupConfig @@ -30,7 +31,8 @@ function getRollupObject ({ minifying, format = 'umd' } = {}) { plugins: [ json(), nodeResolve(), - commonjs() + commonjs(), + babel({ exclude: 'node_modules/**' }) ] }; if (minifying) {