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
@@ -250,6 +250,7 @@
"babel-loader": "^9.1.2",
"babel-plugin-angularjs-annotate": "^0.10.0",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-module-resolver": "^5.0.0",
"backbone": "^1.3.3",
"bootstrap": "^3.4.1",
"c8": "^7.2.0",
+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