File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff 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
11471171Please take a moment to read our contributing guidelines if you haven't yet done so.
You can’t perform that action at this time.
0 commit comments