Skip to content

Allow importing scss files in JS

Simon Knox requested to merge webpack-sass-loader into master

What does this MR do?

  1. Add sass-loader to allow importing SCSS into JS
  2. Fix .css regex in webpack config for CSS files

Was needed to import some colors from variables.scss in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7538#note_104940229

With this MR we can export vars from SCSS and use them.

// variables.scss
$red: #f00;

:export {
  red: $red;
}
// something.js
import { red } from './variables.scss';

console.log(red) // #f00

Does this MR meet the acceptance criteria?

Edited by Simon Knox

Merge request reports