Skip to content

Commit 9367263

Browse files
authored
even if stripPath is false we always put the files in the inlined folder without nesting. (#278)
1 parent e191c80 commit 9367263

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

packages/ember-svg-jar/addon/helpers/svg-jar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import makeSVG from 'ember-svg-jar/utils/make-svg';
33
import { importSync } from '@embroider/macros';
44

55
function getInlineAsset(assetId) {
6+
assetId = assetId.replace(/[/\\]/g, '-');
67
let result = null;
78
try {
89
result = require(`ember-svg-jar/inlined/${assetId}`).default;

packages/ember-svg-jar/lib/utils.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@ function relativePathFor(filePath, inputPath) {
2020
return filePath.replace(`${inputPath}${path.sep}`, '');
2121
}
2222

23+
function relativePathToSingleFilename(filePath) {
24+
return filePath.replace(/[/\\]/g, '-');
25+
}
26+
2327
function makeIDForPath(relativePath, { idGen, stripPath, prefix }) {
2428
return fp.pipe(
25-
relative => (stripPath ? path.basename(relative) : relative),
29+
relative =>
30+
stripPath
31+
? path.basename(relative)
32+
: relativePathToSingleFilename(relative),
2633
stripExtension,
2734
normalizedPath => idGen(normalizedPath, { prefix })
2835
)(relativePath);

packages/ember-svg-jar/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"keywords": [
66
"ember-addon"
77
],
8+
"packageManager": "yarn@1.22.22",
89
"license": "MIT",
910
"author": "Ivan Volti <voltidev@gmail.com>",
1011
"directories": {

packages/ember-svg-jar/tests/acceptance/symbols-loader-test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)