Commit ed1837e7 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '345477-resolve-multi-path-alias-for-webpack' into 'master'

Add some JH aliases for webpack and jest

See merge request gitlab-org/gitlab!74305
parents 0274e1f0 d50c2000
......@@ -163,6 +163,9 @@ const alias = {
// the following resolves files which are different between CE and JH
jh_else_ce: path.join(ROOT_PATH, 'app/assets/javascripts'),
// the following resolves files which are different between CE/EE/JH
any_else_ce: path.join(ROOT_PATH, 'app/assets/javascripts'),
// override loader path for icons.svg so we do not duplicate this asset
'@gitlab/svgs/dist/icons.svg': path.join(
ROOT_PATH,
......@@ -179,6 +182,8 @@ if (IS_EE) {
ee_images: path.join(ROOT_PATH, 'ee/app/assets/images'),
ee_jest: path.join(ROOT_PATH, 'ee/spec/frontend'),
ee_else_ce: path.join(ROOT_PATH, 'ee/app/assets/javascripts'),
jh_else_ee: path.join(ROOT_PATH, 'ee/app/assets/javascripts'),
any_else_ce: path.join(ROOT_PATH, 'ee/app/assets/javascripts'),
});
}
......@@ -190,7 +195,10 @@ if (IS_JH) {
jh_icons: path.join(ROOT_PATH, 'jh/app/views/shared/icons'),
jh_images: path.join(ROOT_PATH, 'jh/app/assets/images'),
jh_jest: path.join(ROOT_PATH, 'jh/spec/frontend'),
// jh path alias https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74305#note_732793956
jh_else_ce: path.join(ROOT_PATH, 'jh/app/assets/javascripts'),
jh_else_ee: path.join(ROOT_PATH, 'jh/app/assets/javascripts'),
any_else_ce: path.join(ROOT_PATH, 'jh/app/assets/javascripts'),
});
}
......
......@@ -51,6 +51,7 @@ module.exports = (path, options = {}) => {
'^shared_queries(/.*)$': '<rootDir>/app/graphql/queries$1',
'^ee_else_ce(/.*)$': '<rootDir>/app/assets/javascripts$1',
'^jh_else_ce(/.*)$': '<rootDir>/app/assets/javascripts$1',
'^any_else_ce(/.*)$': '<rootDir>/app/assets/javascripts$1',
'^helpers(/.*)$': '<rootDir>/spec/frontend/__helpers__$1',
'^vendor(/.*)$': '<rootDir>/vendor/assets/javascripts$1',
[TEST_FIXTURES_PATTERN]: '<rootDir>/tmp/tests/frontend/fixtures$1',
......@@ -72,6 +73,8 @@ module.exports = (path, options = {}) => {
'^ee_component(/.*)$': rootDirEE,
'^ee_else_ce(/.*)$': rootDirEE,
'^ee_jest/(.*)$': '<rootDir>/ee/spec/frontend/$1',
'^any_else_ce(/.*)$': rootDirEE,
'^jh_else_ee(/.*)$': rootDirEE,
[TEST_FIXTURES_PATTERN]: '<rootDir>/tmp/tests/frontend/fixtures-ee$1',
...extModuleNameMapperEE,
});
......@@ -84,8 +87,11 @@ module.exports = (path, options = {}) => {
Object.assign(moduleNameMapper, {
'^jh(/.*)$': rootDirJH,
'^jh_component(/.*)$': rootDirJH,
'^jh_else_ce(/.*)$': rootDirJH,
'^jh_jest/(.*)$': '<rootDir>/jh/spec/frontend/$1',
// jh path alias https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74305#note_732793956
'^jh_else_ce(/.*)$': rootDirJH,
'^jh_else_ee(/.*)$': rootDirJH,
'^any_else_ce(/.*)$': rootDirJH,
...extModuleNameMapperJH,
});
......
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