diff --git a/docs/docs/installation.md b/docs/docs/installation.md index 9c88ecff5..525ae6fa8 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -28,7 +28,7 @@ The autoloader is the easiest way to use Web Awesome. A lightweight script watch ```html - + ``` Now you can [start using Web Awesome!](/getting-started/usage) @@ -39,7 +39,7 @@ While convenient, autoloading may lead to a [Flash of Undefined Custom Elements] ## Setting the Base Path -Some components rely on assets (icons, images, etc.) and Web Awesome needs to know where they're located. For convenience, Web Awesome will try to auto-detect the correct location based on the script you've loaded it from. This assumes assets are colocated with `autoloader.js` and will "just work" for most users. +Some components rely on assets (icons, images, etc.) and Web Awesome needs to know where they're located. For convenience, Web Awesome will try to auto-detect the correct location based on the script you've loaded it from. This assumes assets are colocated with `webawesome.loader.js` and will "just work" for most users. ==If you're using the CDN, you can skip this section.== However, if you're [cherry picking](#cherry-picking) or bundling Web Awesome, you'll need to set the base path. You can do this one of two ways. diff --git a/src/utilities/base-path.ts b/src/utilities/base-path.ts index 94980c0cc..0caccfa71 100644 --- a/src/utilities/base-path.ts +++ b/src/utilities/base-path.ts @@ -10,8 +10,8 @@ export function setBasePath(path: string) { * Gets the library's base path. * * The base path is used to load assets such as icons and images, so it needs to be set for components to work properly. - * By default, this script will look for a script ending in webawesome.js or autoloader.js and set the base path to the - * directory that contains that file. To override this behavior, you can add the data-webawesome attribute to any + * By default, this script will look for a script ending in webawesome.js or webawesome.loader.js and set the base path + * to the directory that contains that file. To override this behavior, you can add the data-webawesome attribute to any * element on the page to point to a local path or a CORS-enabled endpoint, such as a CDN. * * @@ -29,7 +29,7 @@ export function getBasePath(subpath = '') { // Use the data-webawesome attribute setBasePath(el.getAttribute('data-webawesome') || ''); } else { - // Look for webawesome.js or autoloader.js + // Look for webawesome.js or webawesome.loader.js const scripts = [...document.getElementsByTagName('script')] as HTMLScriptElement[]; const waScript = scripts.find( script => script.src.endsWith('webawesome.js') || script.src.endsWith('webawesome.loader.js')