Commit 54f83c7b authored by Mike Greiling's avatar Mike Greiling

Merge branch 'winh-simplify-ee_component' into 'master'

Simplify ee_component resolution

See merge request gitlab-org/gitlab!21109
parents 075a4ae4 01a2bd4a
...@@ -31,7 +31,6 @@ rules: ...@@ -31,7 +31,6 @@ rules:
- error - error
- allowElseIf: true - allowElseIf: true
import/no-cycle: warn import/no-cycle: warn
import/no-unresolved: warn
import/no-useless-path-segments: off import/no-useless-path-segments: off
import/order: warn import/order: warn
lines-between-class-members: off lines-between-class-members: off
......
...@@ -102,6 +102,7 @@ const alias = { ...@@ -102,6 +102,7 @@ const alias = {
if (IS_EE) { if (IS_EE) {
Object.assign(alias, { Object.assign(alias, {
ee: path.join(ROOT_PATH, 'ee/app/assets/javascripts'), ee: path.join(ROOT_PATH, 'ee/app/assets/javascripts'),
ee_component: path.join(ROOT_PATH, 'ee/app/assets/javascripts'),
ee_empty_states: path.join(ROOT_PATH, 'ee/app/views/shared/empty_states'), ee_empty_states: path.join(ROOT_PATH, 'ee/app/views/shared/empty_states'),
ee_icons: path.join(ROOT_PATH, 'ee/app/views/shared/icons'), ee_icons: path.join(ROOT_PATH, 'ee/app/views/shared/icons'),
ee_images: path.join(ROOT_PATH, 'ee/app/assets/images'), ee_images: path.join(ROOT_PATH, 'ee/app/assets/images'),
...@@ -283,16 +284,13 @@ module.exports = { ...@@ -283,16 +284,13 @@ module.exports = {
jQuery: 'jquery', jQuery: 'jquery',
}), }),
new webpack.NormalModuleReplacementPlugin(/^ee_component\/(.*)\.vue/, function(resource) { !IS_EE &&
if (Object.keys(module.exports.resolve.alias).indexOf('ee') >= 0) { new webpack.NormalModuleReplacementPlugin(/^ee_component\/(.*)\.vue/, resource => {
resource.request = resource.request.replace(/^ee_component/, 'ee');
} else {
resource.request = path.join( resource.request = path.join(
ROOT_PATH, ROOT_PATH,
'app/assets/javascripts/vue_shared/components/empty_component.js', 'app/assets/javascripts/vue_shared/components/empty_component.js',
); );
} }),
}),
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ {
......
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