This is an automated email from the ASF dual-hosted git repository. randall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit 363b3606c43762f028d51dd0de256627dc8ca51c Author: Randall Leeds <[email protected]> AuthorDate: Sat Sep 19 19:10:12 2020 -0700 Resolve sources to absolute filenames for development and testing The source directories of packages are not part of their exports, which prevents loading these modules relative to an import of the package by name. Avoid this problem by resolving package name imports to absolute paths during development and testing. --- babel.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 1dddf6a..61a7186 100644 --- a/babel.config.js +++ b/babel.config.js @@ -18,6 +18,8 @@ * under the License. */ +const path = require('path'); + module.exports = (api) => { const ENV = api.env(); const DEV = ENV === 'development'; @@ -53,7 +55,10 @@ module.exports = (api) => { alias: { ...(DEV || TEST ? { - '^@annotator/(.+)$': '@annotator/\\1/src/index.ts', + '^@annotator/([^/]+)$': path.join( + __dirname, + 'packages/\\1/src/index.ts', + ), } : null), // TODO: Remove after babel/babel#8462 ships.
