Merge pull request #14666 from overleaf/ae-babel-plugin-module-resolver

Fix import alias handling for mocha and Storybook

GitOrigin-RevId: aa2fd23bb1ca1ebc44afc725258bc61d3d100038
This commit is contained in:
Alf Eaton
2023-09-12 08:03:53 +00:00
committed by Copybot
parent 1dc3d12c1d
commit ccb0a1bff8
3 changed files with 268 additions and 0 deletions
+1
View File
@@ -1,6 +1,7 @@
// Run babel on tests to allow support for import/export statements in Node
require('@babel/register')({
extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],
plugins: [['module-resolver', { alias: { '^@/(.+)': './frontend/js/\\1' } }]],
})
// Load JSDOM to mock the DOM in Node