altgifted/babel-plugin-transform-scss

Does not work for nested packages

Opened this issue · 0 comments

I am using this plugin in a monorepo where we publish multiple packages. We have a root package.json used for local testing, but each component declares its own dependencies in a child folder:

package.json
components/
  component1/
    package.json
  component2/
    package.json

When I try to use the plugin to build the components, the build fails unless I have the libraries that provide the stylesheets I'm trying to include declared in the root package.json. This works ok as a workaround, but is not desirable. I think the problem may stem from these lines that assume dependencies are available from the process root: https://github.com/altgifted/babel-plugin-transform-scss/blob/master/lib/index.js#L65-L66