solring / react-scss-template

0 stars 0 forks source link

Path resolving ways are different between node-scss and scss-loader. #1

Open solring opened 3 years ago

solring commented 3 years ago

When loading resourse(e.g. images) using url in scss, the ways of resolving paths are different between create-react-app and storybook.

Example:

// for create-react-app
background: center / contain no-repeat url(../images/logo-ANSWER.svg);
// for storybook
background: center / contain no-repeat url(./assets/images/logo-ANSWER.svg);
solring commented 3 years ago

related issue: https://github.com/storybookjs/storybook/issues/10990

ref: https://www.npmjs.com/package/resolve-url-loader

need to use resolve-url-loader in storybook, or remove resolve-url-loader in the project's webpack setting (need to eject first).