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
Since I use storybook and rollup in the same package, I noticed some differences in how module resolve during import works.
The package I am trying to import holds a file called _index.scss. node_modules/my-ui-kit/_index.scss
Inside some scss file I am trying to build, I try to import it like I would with webpack's sass-loader:
@import "~my-ui-kit";
webpack's sass-loader would load node_modules/my-ui-kit/_index.scss but rollup-plugin-postcss just fails. It falsely assumes that my-ui-kit is the partial and tries to load /_my-ui-kit/.
Since I use storybook and rollup in the same package, I noticed some differences in how module resolve during import works.
The package I am trying to import holds a file called
_index.scss
.node_modules/my-ui-kit/_index.scss
Inside some scss file I am trying to build, I try to import it like I would with webpack's sass-loader:
webpack's sass-loader would load
node_modules/my-ui-kit/_index.scss
butrollup-plugin-postcss
just fails. It falsely assumes thatmy-ui-kit
is the partial and tries to load/_my-ui-kit/
.https://github.com/egoist/rollup-plugin-postcss/blob/master/src/sass-loader.js#L63
partialUrl = "/_my-ui-kit"
webpack
sass-loader
passesmainFields: ['_index', 'index']
to resolve - maybe we could use something like this too? https://github.com/webpack-contrib/sass-loader/blob/master/src/utils.js#L351Would be open to do a PR if you could give me some initial support. (Update: PR)
The text was updated successfully, but these errors were encountered: