To include the material css the following worked for me:
First create file config/sass.config.json
Second Enter the following:
// cross verify with node_modules/@ionic/app-scripts/config/sass.config.js
module.exports = {
/**
* includePaths: Used by node-sass for additional
* paths to search for sass imports by just name.
*/
includePaths: [
'node_modules/ionic-angular/themes',
'node_modules/ionicons/dist/scss',
'node_modules/ionic-angular/fonts',
'node_modules/@angular/material/prebuilt-themes'
],
includeFiles: [
/\.(s?(c|a)ss)$/i
],
excludeFiles: [
// /\.(wp|ios|md).(scss)$/i
],
};
Third in packages.json at the bottom (still inside the last curly bracket) add
"config": {
"ionic_sass": "./config/sass.config.js"
},
Fourth run
ionic serve
Explenation
The inlcudeFiles part is to be able to also include css (as the prebuild angular-material indigo-pink is an css and not an scss file.
The exclude files excludes a lot of ionic-css. I had the feeling some of the default ionic theme interferes with angular-material css, so I put this. BUT: Only put these lines if you are not planning to use the default components.
You can get rid of more default css such as ionicons as explained here https://julienrenaux.fr/2017/07/20/optimized-ionic-angular-css-bundle-for-pwas/#Remove_ionicons