Resolve multi-path alias for webpack
Problem to solve
Add multi-path alias support in webpack.config.js
makes it possible to resolve path follow the order below:
jh
=> ee
=> ce
Proposal
if (IS_JH) {
Object.assign(alias, {
jh: path.join(ROOT_PATH, 'jh/app/assets/javascripts'),
jh_component: path.join(ROOT_PATH, 'jh/app/assets/javascripts'),
jh_empty_states: path.join(ROOT_PATH, 'jh/app/views/shared/empty_states'),
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_else_ce: path.join(ROOT_PATH, 'jh/app/assets/javascripts'),
jh_else_ee: [
path.join(ROOT_PATH, 'jh/app/assets/javascripts'),
path.join(ROOT_PATH, 'ee/app/assets/javascripts'),
path.join(ROOT_PATH, 'app/assets/javascripts'),
],
});
}