I created preact template from default preact-cli template
added:
"sass": "^1.45.1",
"sass-loader": "^10.2.0",
import global scss file into index.js and global styles work fine
import "./style/global.scss";
import App from "./components/app";
export default App;
added into global.scss file mixin and scss vars:
@mixin br {
border-radius: 12px;
}
and when i try to use it in some component like:
.merchant {
margin-bottom: 4px;
@include br;
}
I get error:
Module build failed (from ../node_modules/preact-cli/lib/lib/webpack/proxy-loader.js):
@include br;
^
Undefined mixin.
╷
6 │ @include br;
│ ^^^^^^^^^^^
╵
stdin 6:5 root stylesheet
in ./src/components/header/style.scss (line 6, column 5)
@ ./components/header/style.scss 2:12-238 9:17-24 13:7-14 45:20-27 47:4-60:5 49:6-59:7 50:38-45 56:26-33 58:21-28 68:15-22
@ ./components/header/index.js
@ ./components/app.js
@ ./index.js
@ ../node_modules/preact-cli/lib/lib/entry.js
looks like i need to something like loader for this and where I need to add it?