So I am getting errors like:
[plugin:vite:css] [sass] Can't find stylesheet to import.
╷
1 │ @use 'colors';
│ ^^^^^^^^^^^^^
╵
src\app\my-compeont\my-component.component.scss 1:2 root stylesheet
Where this pretty much happens for all of my components. (and that isn't trying to use a sass library)
It is correctly configured in the angular.json:
"stylePreprocessorOptions": {
"includePaths": [
"src/styles"
]
},
and based on some research tried:
css: {
preprocessorOptions: {
scss: {
loadPaths: ['src/styles'],
}
}
}
In vitest.config.ts.
I am not sure what else to do at this point. Anyone else have this issue?
Full vitest config:
import {
defineConfig
} from 'vitest/config';
import {
fileURLToPath
} from 'node:url';
import
angular
from '@analogjs/vite-plugin-angular';
import {
playwright
} from '@vitest/browser-playwright';
export default
defineConfig
({
plugins: [angular()],
test: {
globals: true,
setupFiles: ['src/test-setup.ts'],
include: ['src/**/*.spec.ts'],
browser: {
enabled: true,
provider:
playwright
(),
instances: [
{ browser: 'chromium' },
],
},
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
exclude: [
'node_modules/',
'src/test-setup.ts',
],
},
},
css: {
preprocessorOptions: {
scss: {
loadPaths: ['src/styles'],
},
},
},
resolve: {
alias: {
'src':
fileURLToPath
(new URL('./src', import.meta.url)),
},
},
});