evoactivity/ember-svg-jar

Configuration options not picked up when used in an addon

Closed this issue ยท 3 comments

๐Ÿž Bug Report

Describe the bug

Options specified in an addon's ember-cli-build.js โ€“ that is consumed by an app โ€“ are not applied.

Reproduce the bug

  • Create an ember addon.
  • Install ember-svg-jar in the addon
  • Set some svgJar options in the addon's ember-cli-build.js
  • Create an ember app
  • Install your newly created addon in your newly created ember app
  • Render an icon in your app
  • Notice the options you specified in the addon's ember-cli-build.js are not applied

Expected behavior

Options specified in an addon's ember-cli-build.js โ€“ that is consumed by an app โ€“ are applied.

Possible Solution

No idea.

Screenshots

Example ember-cli-build.js options in an addon:

And source from an icon rendered in the app. Notice xmlns is still present, and the html IDs are still minified:

Additional context

  • ember-cli 3.17.0
  • ember-svg-jar 2.2.3
  • svgo 1.3.2

One of the outcomes of this issue for us is we cannot use svgs with the following structure:

The reason is their IDs collide because they are all minified to the same two letters: #a for path and #b for clipPath.

This is possibly a dup of โ€“ or at min overlapping with โ€“ #106.

This comment on #106 got things working for me: #106 (comment)

I needed to:

  1. Move ember-svg-jar from dependencies to devDependencies in my addon
  2. Install ember-svg-jar indevDependencies in my app
  3. Copy the svgJar config from my addon's ember-cli-build.js to app's ember-cli-build.js
  4. Update the sourceDirs path in the svgJar config to be an absolute path that points to my addon

It seems like there should be โ€“ or it would be nice if there were โ€“ a way to not have to install ember-svg-jar in all apps and addons and copy the config into each.