diff options
author | Mike Greiling <mike@pixelcog.com> | 2019-07-29 23:25:59 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2019-07-30 00:44:45 +0300 |
commit | b0ba7c72de0a864b01ec1c4be626a8a233a9009f (patch) | |
tree | d1e69300285401dead74dca35920363592760b15 | |
parent | 7d68ac70aa111ab17cfb01e12ace7fa09fedb90b (diff) |
Override icons.svg asset path with sprockets asset
-rw-r--r-- | app/assets/javascripts/lib/utils/icons_path.js | 3 | ||||
-rw-r--r-- | config/webpack.config.js | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/icons_path.js b/app/assets/javascripts/lib/utils/icons_path.js new file mode 100644 index 00000000000..1a1c3c8e7b3 --- /dev/null +++ b/app/assets/javascripts/lib/utils/icons_path.js @@ -0,0 +1,3 @@ +// any import of '@gitlab/svgs/dist/icons.svg' will be overridden with this +// to avoid asset duplication between sprockets and webpack +export default gon && gon.sprite_icons; diff --git a/config/webpack.config.js b/config/webpack.config.js index f00a9ac0df9..c497a6e88f8 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -89,6 +89,12 @@ const alias = { // the following resolves files which are different between CE and EE ee_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, + 'app/assets/javascripts/lib/utils/icons_path.js', + ), }; if (IS_EE) { |