Skip to content

Commit

Permalink
fix(babel): transform alias with right current directory
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjianhua committed Jan 11, 2019
1 parent f0ff9b0 commit db0d656
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/config/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ function getAliasPlugin() {
require.resolve('babel-plugin-module-resolver'),
{
alias: mergedAlias,
// https://github.com/tleunen/babel-plugin-module-resolver/blob/master/DOCS.md#cwd
// in monorepo, build inside sub package is fine, but run all test files
// of all sub packages from root directory caused the incorrect target file
// use closet package.json as the current directory to transform path
cwd: 'packagejson',
},
]
}

0 comments on commit db0d656

Please # to comment.