Skip to content
Snippets Groups Projects

Replace ruby-sass with dart-sass (node)

Merged Muhammed Ali requested to merge gitlab-community/gitlab:replace-sass into master
2 unresolved threads
1 file
+ 17
0
Compare changes
  • Side-by-side
  • Inline
@@ -7,6 +7,23 @@ import glob from 'glob';
import * as esbuild from 'esbuild';
import prettier from 'prettier';
/**
* VISION: This script could be made more generalizable, to be able to
* "normalize" our complete asset folder in order to easily diff them.
*
* It might even be great to have support for using MRs/Pipelines, etc.
*
* normalize_assets.mjs https://gitlab.com/gitlab-org/gitlab/-/pipelines/1143467234 tmp/current_master
* normalize_assets.mjs https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140611 tmp/after_change
*/
/**
* 1. this function removes the `hash` from the file name
* (sprockets is unhappy compiling without hash)
* 2. Minifies the css, to remove comments and normalize things like
* `#ffffff` and `#fff` or `.5rem` and `0.5rem`
* 3. Prettifies it again, to make it diffable
*/
async function cleanUpCSSFile(sourceFile, sourceDir, targetDir) {
const targetFile = join(targetDir, relative(sourceDir, sourceFile)).replace(
/-[a-f0-9]{20,}.css$/,
Loading