Skip to content

Commit 4869a3c

Browse files
committed
don't set a default value
1 parent bb0f1cb commit 4869a3c

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ yarn build # to build the project
168168
Afterwards, you can find the build output in the `dist` folder of the corresponding package folder.
169169
For example, to find the Button component (that belongs to the `main` package), look inside the `packages/main/dist` folder.
170170

171+
*Note: before building the project you can also set the `PUBLIC_DEPLOY_PATH` environment variable to specify the path where non-bundled assets will be fetched from*
172+
173+
*For example: ``
174+
171175
## Limitations
172176
None as of 1.0.0-rc.8
173177

docs/Configuration.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ language | en, de, es, etc... | en |
1414
calendarType | Gregorian, Islamic, Buddhist, Japanese, Persian | Gregorian | Default calendar type for date-related web components
1515
[noConflict](#noConflict) | true, false | false | When set to true, all events will be fired with a "ui5-" prefix only
1616
[formatSettings](#formatSettings)| See the [Format settings](#formatSettings) section below | Empty object | Allows to override locale-specific configuration
17-
[assetsPath](#assetsPath)| See the [Assets path](#assetsPath) section below | `/resources/` | Allows to set the assets path at runtime
17+
[assetsPath](#assetsPath)| See the [Assets path](#assetsPath) section below | Empty string | Allows to set the assets path at runtime
1818

1919
### Content Density
2020

@@ -105,10 +105,11 @@ firstDayOfWeek | 0 (Sunday) through 6 (Saturday) | *Depends on locale* | Whe
105105
<a name="assetsPath"></a>
106106
### Assets path
107107

108-
<b>Note:</b> This configuration setting only has effect for bundles, created with the UI5 Web Components tools (`@ui5/webcomponents-tools`).
109-
110-
The `assetsPath` setting allows to override the path where asset files (most commonly `.json` ) are located. UI5 Web Components `tools` use `rollup`
111-
with the `rollup-plugin-url` plugin and `/resources/` is set as the default directory for all non-bundled assets.
108+
This configuration setting allows to set the path where asset files (most commonly `.json` ) that are to be fetched at runtime, are located. These are:
109+
- Icon collections
110+
- `i18n` message bundles
111+
- `CLDR` files
112+
- Additional themes
112113

113114
For some scenarios the same bundle will be reused from different directories, or the directory structure is unknown in advance. Therefore it's
114115
necessary to be able to pass the right directory at runtime, most commonly inside the configuration script directly:
@@ -122,7 +123,6 @@ Example:
122123
</script>
123124
```
124125

125-
126126
## Configuration script
127127

128128
In order to provide configuration settings, include the following ```<script>``` element in your HTML page:

packages/base/src/InitialConfiguration.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let initialConfig = {
1313
noConflict: false, // no URL
1414
formatSettings: {},
1515
useDefaultLanguage: false,
16-
assetsPath: "/resources/",
16+
assetsPath: "",
1717
};
1818

1919
/* General settings */

packages/base/src/util/getEffectiveAssetPath.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { getAssetsPath } from "../config/AssetsPath.js";
22

33
const getEffectiveAssetPath = asset => {
44
const assetsPath = getAssetsPath();
5-
if (typeof asset === "string" && asset.startsWith("/UI5_RESOURCES_PATH/")) {
6-
return asset.replace(/^\/UI5_RESOURCES_PATH\//, assetsPath);
5+
if (assetsPath && typeof asset === "string") {
6+
return `${assetsPath}${asset}`;
77
}
88

99
return asset;

packages/main/test/pages/Kitchen.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<script data-ui5-config type="application/json">
1111
{
12-
"assetsPath": "/resources/"
12+
"assetsPath": ""
1313
}
1414
</script>
1515

packages/tools/components-package/nps.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const getScripts = (options) => {
4848
default: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle" "nps watch.styles"',
4949
src: 'nps "copy.src --watch --safe --skip-initial-copy"',
5050
test: 'nps "copy.test --watch --safe --skip-initial-copy"',
51-
bundle: "rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV",
51+
bundle: "rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV,DEPLOY_PUBLIC_PATH:/resources/",
5252
styles: {
5353
default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
5454
themes: 'nps "build.styles.themes -w"',

packages/tools/components-package/rollup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function ui5DevImportCheckerPlugin() {
2626

2727
const getPlugins = ({ transpile }) => {
2828
const plugins = [];
29-
let publicPath = DEPLOY_PUBLIC_PATH || "/UI5_RESOURCES_PATH/";
29+
let publicPath = DEPLOY_PUBLIC_PATH;
3030

3131
if (!process.env.DEV) {
3232
plugins.push(filesize({

0 commit comments

Comments
 (0)