From 9d0fddcb8c39896d414a3c5ac7f6e224322f60e0 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Wed, 25 Oct 2023 12:30:29 +0200 Subject: [PATCH] :alien: Ensure jest can handle ES modules Thread for reference: https://github.com/jestjs/jest/issues/6229 * Updated jest config to compile packages published as ESM * Moved babel config from .babelrc to babel.config.js, .babelrc is not properly picked anymore in Babel v7 (see linked ref above) --- .babelrc | 15 --------------- babel.config.js | 12 ++++++++++++ package.json | 4 ++++ 3 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 .babelrc create mode 100644 babel.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index e062e6bc84..0000000000 --- a/.babelrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "presets": [ - "@babel/preset-env", - "@babel/react" - ], - "plugins": [ - [ - "formatjs", - { - "idInterpolationPattern": "[sha512:contenthash:base64:6]", - "ast": true - } - ] - ] -} diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000000..9d62b4d612 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,12 @@ +module.exports = { + presets: ['@babel/preset-env', '@babel/react'], + plugins: [ + [ + 'formatjs', + { + idInterpolationPattern: '[sha512:contenthash:base64:6]', + ast: true, + }, + ], + ], +}; diff --git a/package.json b/package.json index 7ab6a89fea..b686517aeb 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,10 @@ ], "modulePaths": [ "/src/openforms/js" + ], + "transformIgnorePatterns": [ + "/node_modules/(?!@open-formulieren/formio-builder)/", + "\\.pnp\\.[^\\\/]+$" ] }, "browserslist": [