Skip to content

Commit

Permalink
👽 Ensure jest can handle ES modules
Browse files Browse the repository at this point in the history
Thread for reference: jestjs/jest#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)
  • Loading branch information
sergei-maertens committed Oct 25, 2023
1 parent 1539ed5 commit 05f5061
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
15 changes: 0 additions & 15 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ WORKDIR /app

# copy configuration/build files
COPY ./build /app/build/
COPY ./*.json ./*.js ./.babelrc /app/
COPY ./*.json ./*.js /app/

# install WITH dev tooling
RUN npm ci --legacy-peer-deps
Expand Down
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
presets: ['@babel/preset-env', '@babel/react'],
plugins: [
[
'formatjs',
{
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true,
},
],
],
};
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
],
"modulePaths": [
"<rootDir>/src/openforms/js"
],
"transformIgnorePatterns": [
"/node_modules/(?!@open-formulieren/formio-builder)/",
"\\.pnp\\.[^\\\/]+$"
]
},
"browserslist": [
Expand Down

0 comments on commit 05f5061

Please sign in to comment.