You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to run rollup within another-library, the rollup-plugin-postcss plugin complains that it cannot find packages/another-library/node_modules/node-scss, which doesn't exist. This is because the node_modules directory isn't inside another-library, but two levels up from us.
Possible Solutions
It looks like the localRequire function is to blame, since it is hard-coded to only look in the current working directory:
This would be a quick & dirty fix. Otherwise, maybe just ditching localRequire and using normal require might work, on the grounds that rollup-plugin-postcss and node-sass should be installed to the same place anyhow. Another option is enhance localRequire using the node-resolve package, so it will accurately search for the node_modules directory starting in the current working directory.
The text was updated successfully, but these errors were encountered:
I am using Yarn workspaces, which allows several projects to live in the same Git repository and share a common
node_modules
folder:When I try to run rollup within
another-library
, therollup-plugin-postcss
plugin complains that it cannot findpackages/another-library/node_modules/node-scss
, which doesn't exist. This is because thenode_modules
directory isn't insideanother-library
, but two levels up from us.Possible Solutions
It looks like the
localRequire
function is to blame, since it is hard-coded to only look in the current working directory:One solution might be to have
localRequire
fall back on normal require if there's an issue:This would be a quick & dirty fix. Otherwise, maybe just ditching
localRequire
and using normalrequire
might work, on the grounds thatrollup-plugin-postcss
andnode-sass
should be installed to the same place anyhow. Another option is enhancelocalRequire
using thenode-resolve
package, so it will accurately search for thenode_modules
directory starting in the current working directory.The text was updated successfully, but these errors were encountered: