Commits on Source (2)
-
Muhammed Ali authored
Add cssbundling-rails and remove sassc-rails from the GitLab project. `cssbundling-rails` enhances `assets:precompile` to invoke `yarn build:css`. Ran the setup command for `cssbundling-rails Added a rudimentary `build-css` script to compile assets using Dart Sass NodeJS because `sassc-rails` is not being used, we have to load `sprockets/railtie` ourselves Changelog: changed
-
Muhammed Ali authored
GitLab has custom assets for EE/JH which need to be compiled only when EE/JH is used Wrote a simple `compile.mjs` script that uses `IS_EE` and `IS_JH` to generate the list of assets that need to be compiled The list of assets to compile is statically listed, with directories recursed and all top-level `.scss` files that don't start with `_` are compiled The destination path for single assets is explicitly specified, but for directories it's generated as the directory is recursed. Sass JS API is not configurable enough to replicate the same behaviour as the Sass CLI. So there might be differences between `build-css` and `compile.mjs`
Showing
- Gemfile 1 addition, 1 deletionGemfile
- Gemfile.checksum 1 addition, 3 deletionsGemfile.checksum
- Gemfile.lock 3 additions, 9 deletionsGemfile.lock
- app/assets/builds/.keep 0 additions, 0 deletionsapp/assets/builds/.keep
- bin/build-css 44 additions, 0 deletionsbin/build-css
- config/application.rb 3 additions, 3 deletionsconfig/application.rb
- package.json 3 additions, 1 deletionpackage.json
- scripts/frontend/compile.mjs 150 additions, 0 deletionsscripts/frontend/compile.mjs
... | ... | @@ -336,7 +336,7 @@ gem 'gitlab_chronic_duration', '~> 0.12' # rubocop:todo Gemfile/MissingFeatureCa |
gem 'rack-proxy', '~> 0.7.7' # rubocop:todo Gemfile/MissingFeatureCategory | ||
gem 'sassc-rails', '~> 2.1.0' # rubocop:todo Gemfile/MissingFeatureCategory | ||
gem 'cssbundling-rails', '1.3.3', feature_category: :shared | ||
gem 'autoprefixer-rails', '10.2.5.1' # rubocop:todo Gemfile/MissingFeatureCategory | ||
gem 'terser', '1.0.2' # rubocop:todo Gemfile/MissingFeatureCategory | ||
... | ... |
app/assets/builds/.keep
0 → 100644
bin/build-css
0 → 100755
... | ... | @@ -46,7 +46,9 @@ |
"swagger:validate": "swagger-cli validate", | ||
"webpack": "NODE_OPTIONS=\"${NODE_OPTIONS:=--max-old-space-size=5120}\" webpack --config config/webpack.config.js", | ||
"webpack-vendor": "NODE_OPTIONS=\"${NODE_OPTIONS:=--max-old-space-size=5120}\" webpack --config config/webpack.vendor.config.js", | ||
"webpack-prod": "NODE_OPTIONS=\"${NODE_OPTIONS:=--max-old-space-size=5120}\" NODE_ENV=production webpack --config config/webpack.config.js" | ||
"webpack-prod": "NODE_OPTIONS=\"${NODE_OPTIONS:=--max-old-space-size=5120}\" NODE_ENV=production webpack --config config/webpack.config.js", | ||
"build:css": "node ./scripts/frontend/compile.mjs", | ||
"build:css:watch": "./bin/build-css --watch" | ||
}, | ||
"dependencies": { | ||
"@apollo/client": "^3.5.10", | ||
... | ... |
scripts/frontend/compile.mjs
0 → 100644