Skip to content

Commit a8ace71

Browse files
authoredMar 22, 2021
docs: update (#597)
1 parent dde71f0 commit a8ace71

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
 

‎README.md

+24
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,30 @@ module.exports = {
11421142
};
11431143
```
11441144

1145+
##### `yarn workspaces` and `monorepos`
1146+
1147+
When using `yarn workspaces` or` monorepos`, relative copy paths from node_modules can be broken due to the way packages are hoisting.
1148+
To avoid this, should explicitly specify where to copy the files from using `require.resolve`.
1149+
1150+
**webpack.config.js**
1151+
1152+
```js
1153+
module.exports = {
1154+
plugins: [
1155+
new CopyPlugin({
1156+
patterns: [
1157+
{
1158+
from: `${path.dirname(
1159+
require.resolve(`${moduleName}/package.json`)
1160+
)}/target`,
1161+
to: "target",
1162+
},
1163+
],
1164+
}),
1165+
],
1166+
};
1167+
```
1168+
11451169
## Contributing
11461170

11471171
Please take a moment to read our contributing guidelines if you haven't yet done so.

0 commit comments

Comments
 (0)
Please sign in to comment.