Commit 09ca2506 authored by KunQian's avatar KunQian

Make the scss file overwriting works in jh folder

parent 64a920f2
/*
This is a noop-file. In JH:
jh/app/assets/stylesheets/_jh/application_jh.scss
will take precedence over it and import more styles
*/
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
// EE-only stylesheets // EE-only stylesheets
@import 'application_ee'; @import 'application_ee';
// JH-only stylesheets
@import 'application_jh';
/* print styles */ /* print styles */
@media print { @media print {
@import 'print'; @import 'print';
......
...@@ -264,7 +264,9 @@ module Gitlab ...@@ -264,7 +264,9 @@ module Gitlab
# Import path for EE specific SCSS entry point # Import path for EE specific SCSS entry point
# In CE it will import a noop file, in EE a functioning file # In CE it will import a noop file, in EE a functioning file
# Order is important, so that the ee file takes precedence: # Order is important, so that the ee file takes precedence:
config.assets.paths << "#{config.root}/jh/app/assets/stylesheets/_jh" if Gitlab.jh?
config.assets.paths << "#{config.root}/ee/app/assets/stylesheets/_ee" if Gitlab.ee? config.assets.paths << "#{config.root}/ee/app/assets/stylesheets/_ee" if Gitlab.ee?
config.assets.paths << "#{config.root}/app/assets/stylesheets/_jh"
config.assets.paths << "#{config.root}/app/assets/stylesheets/_ee" config.assets.paths << "#{config.root}/app/assets/stylesheets/_ee"
config.assets.paths << "#{config.root}/vendor/assets/javascripts/" config.assets.paths << "#{config.root}/vendor/assets/javascripts/"
......
...@@ -5,6 +5,7 @@ const path = require('path'); ...@@ -5,6 +5,7 @@ const path = require('path');
const sass = require('node-sass'); // eslint-disable-line import/no-unresolved const sass = require('node-sass'); // eslint-disable-line import/no-unresolved
const { buildIncludePaths, resolveGlobUrl } = require('node-sass-magic-importer/dist/toolbox'); // eslint-disable-line import/no-unresolved const { buildIncludePaths, resolveGlobUrl } = require('node-sass-magic-importer/dist/toolbox'); // eslint-disable-line import/no-unresolved
const webpack = require('webpack'); const webpack = require('webpack');
const IS_JH = require('../../config/helpers/is_jh_env');
const gitlabWebpackConfig = require('../../config/webpack.config'); const gitlabWebpackConfig = require('../../config/webpack.config');
const ROOT = path.resolve(__dirname, '../../'); const ROOT = path.resolve(__dirname, '../../');
...@@ -13,11 +14,20 @@ const TRANSPARENT_1X1_PNG = ...@@ -13,11 +14,20 @@ const TRANSPARENT_1X1_PNG =
const SASS_INCLUDE_PATHS = [ const SASS_INCLUDE_PATHS = [
'app/assets/stylesheets', 'app/assets/stylesheets',
'app/assets/stylesheets/_ee', 'app/assets/stylesheets/_ee',
'app/assets/stylesheets/_jh',
'ee/app/assets/stylesheets', 'ee/app/assets/stylesheets',
'ee/app/assets/stylesheets/_ee', 'ee/app/assets/stylesheets/_ee',
'node_modules', 'node_modules',
].map((p) => path.resolve(ROOT, p)); ].map((p) => path.resolve(ROOT, p));
if (IS_JH) {
SASS_INCLUDE_PATHS.push(
...['jh/app/assets/stylesheets', 'jh/app/assets/stylesheets/_jh'].map((p) =>
path.resolve(ROOT, p),
),
);
}
/** /**
* Custom importer for node-sass, used when LibSass encounters the `@import` directive. * Custom importer for node-sass, used when LibSass encounters the `@import` directive.
* Doc source: https://github.com/sass/node-sass#importer--v200---experimental * Doc source: https://github.com/sass/node-sass#importer--v200---experimental
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment