Skip to content

Commit

Permalink
fix(essentials): use require.resolve to ensure Yarn PnP compatibility
Browse files Browse the repository at this point in the history
`register` file of various addon should be resolve in the context of `addon-essentials` and not in the one of SB user projects
  • Loading branch information
gaetanmaisse committed May 1, 2020
1 parent d44ff25 commit 7d2dab6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"ts-dedent": "^1.1.1"
},
"devDependencies": {
"@types/jest": "^25.1.1"
"@types/jest": "^25.1.1",
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"babel-loader": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion addons/essentials/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export function managerEntries(entry: any[] = [], options: PresetOptions = {}) {
.filter((key) => (options as any)[key] !== false)
.map((key) => makeAddon(key))
.filter((addon) => !isInstalled(addon))
.map((addon) => `${addon}/register`);
.map((addon) => require.resolve(`${addon}/register`));
return [...entry, ...registerAddons];
}
2 changes: 1 addition & 1 deletion addons/essentials/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"types": ["jest"]
"types": ["webpack-env", "jest"]
},
"include": ["src/**/*"],
"exclude": ["src/**.test.ts"]
Expand Down

0 comments on commit 7d2dab6

Please sign in to comment.