Steps to reproduce:
- Run
preact create <app-name>
cd <app-name>
npm install --D material-web-components
- In a
.scss file, include @import "~@material/drawer/mdc-drawer"; to import the styles for the Material drawer.
npm run build
Expected result:
The build will succeed.
Actual result:
The build fails. It turns out that @material/drawer/mdc-drawer is dependent on @material/rtl/mixins but, since that import isn't prefixed by a ~, Webpack doesn't know where to find it.
A quick fix (although probably not the most efficient fix) is to just tell sass-loader (and less-loader) to look in node_modules to resolve imports. I will do a quick PR if that seems like the right solution.