-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(framework): Support custom dynamic asset paths (#2305)
- Loading branch information
1 parent
efe8b40
commit ff245fa
Showing
7 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { registerI18nBundle } from "./asset-registries/i18n.js"; | ||
import { registerCldr, _registerMappingFunction as registerCldrMappingFunction } from "./asset-registries/LocaleData.js"; | ||
import { registerThemeProperties } from "./asset-registries/Themes.js"; | ||
import { registerAssetPathMappingFunction } from "./util/EffectiveAssetPath.js"; | ||
|
||
export { | ||
registerCldr, | ||
registerCldrMappingFunction, | ||
registerThemeProperties, | ||
registerI18nBundle, | ||
registerAssetPathMappingFunction, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { getAssetsPath } from "../config/AssetsPath.js"; | ||
|
||
let assetPathMappingFn = assetName => assetName; | ||
|
||
const getEffectiveAssetPath = assetName => { | ||
if (typeof assetName !== "string") { | ||
return assetName; | ||
} | ||
|
||
assetName = assetPathMappingFn(assetName); | ||
|
||
const assetsPathPrefix = getAssetsPath(); | ||
if (assetsPathPrefix) { | ||
return `${assetsPathPrefix}${assetName}`; | ||
} | ||
|
||
return assetName; | ||
}; | ||
|
||
const registerAssetPathMappingFunction = mappingFn => { | ||
assetPathMappingFn = mappingFn; | ||
}; | ||
|
||
export { | ||
getEffectiveAssetPath, | ||
registerAssetPathMappingFunction, | ||
}; |
This file was deleted.
Oops, something went wrong.