From 20a65f6b123c9107faed065c9f0401c669661647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20Vujovi=C4=87?= Date: Mon, 10 Oct 2022 22:29:47 +0200 Subject: [PATCH] feat: Add Babel config programmaticaly --- cli/cli.js | 6 ++++++ examples/babel.config.json | 8 -------- tests/babel.config.json | 8 -------- 3 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 examples/babel.config.json delete mode 100644 tests/babel.config.json diff --git a/cli/cli.js b/cli/cli.js index 1ac53f708..6858da042 100755 --- a/cli/cli.js +++ b/cli/cli.js @@ -98,6 +98,12 @@ async function createJsFileWithRullup(sourceFileWithPath, rollupTarget) { babel({ babelHelpers: "bundled", extensions: [".ts", ".js", ".jsx", ".es6", ".es", ".mjs"], + presets: ["@babel/preset-typescript"], + plugins: [ + "near-sdk-js/lib/build-tools/include-bytes.js", + "near-sdk-js/lib/build-tools/near-bindgen-exporter.js", + ["@babel/plugin-proposal-decorators", { version: "legacy" }], + ], }), ], }); diff --git a/examples/babel.config.json b/examples/babel.config.json deleted file mode 100644 index e1d155602..000000000 --- a/examples/babel.config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugins": [ - "near-sdk-js/lib/build-tools/include-bytes", - "near-sdk-js/lib/build-tools/near-bindgen-exporter", - ["@babel/plugin-proposal-decorators", { "version": "legacy" }] - ], - "presets": ["@babel/preset-typescript"] -} diff --git a/tests/babel.config.json b/tests/babel.config.json deleted file mode 100644 index e1d155602..000000000 --- a/tests/babel.config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugins": [ - "near-sdk-js/lib/build-tools/include-bytes", - "near-sdk-js/lib/build-tools/near-bindgen-exporter", - ["@babel/plugin-proposal-decorators", { "version": "legacy" }] - ], - "presets": ["@babel/preset-typescript"] -}