I ran into this on a project I'm working on that I based on this sample repo. sass-loader seems to remove whitespace by default, which means azure-devops-ui/buildScripts/css-variables-loader fails to produce valid CSS when using certain Formula Design styles.
I have a repro branch in my fork, but in short, adding a reference to $neutral-4 (or any similar color style) in any .scss file leads to a build failure when running npm run build.
Upon debugging the webpack script, I found that the whole .sass file is being collapsed down to a single line before it hits css-variables-loader. But css-variables-loader is designed to process the file line by line, so we end up with invalid css as a result.
As a fix, I'm just specifying the 'expanded' output style for sass-loader. This worked for my use case, however I'm not primarily a frontend developer so I would not be surprised if there's a better way to do this.
I ran into this on a project I'm working on that I based on this sample repo. sass-loader seems to remove whitespace by default, which means
azure-devops-ui/buildScripts/css-variables-loader
fails to produce valid CSS when using certain Formula Design styles.I have a repro branch in my fork, but in short, adding a reference to $neutral-4 (or any similar color style) in any .scss file leads to a build failure when running
npm run build
.Here's the output I get with my repro case:
Upon debugging the webpack script, I found that the whole .sass file is being collapsed down to a single line before it hits css-variables-loader. But css-variables-loader is designed to process the file line by line, so we end up with invalid css as a result.
As a fix, I'm just specifying the 'expanded' output style for sass-loader. This worked for my use case, however I'm not primarily a frontend developer so I would not be surprised if there's a better way to do this.