Cant resolve .scss file in aurelia cli with webpack

I’m using aurelia cli with default, I have placed my styles in static folder and copied them into the dist folder using CopyWebpackPlugin and it works fine.

I’m using sass-loader to load SCSS files, now the problem is requiring scss files in app.html as follows
<require from="/styles/sass/ots-theme-styles.scss"></require> and it throws error as shown below.

ERROR in ./src/app.html Module not found: Error: Can't resolve '/styles/sass/ots-theme-styles.scss' in '/home/sundar/Downloads/work/demo/src' @ ./src/app.html @ ./src/app.js @ ./src/main.js @ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js @ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-bootstrapper

but i can see styles in dist folder.

-TIA

1 Like

It should work. Could you try a relative path instead of a fixed one. Like <require from="../styles/sass/ots-theme-styles.scss"></require>

1 Like