Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/WebReflection/lazytag
Lazy loading Custom Elements and their styles without even thinking about it.
https://github.com/WebReflection/lazytag
Last synced: 3 months ago
JSON representation
Lazy loading Custom Elements and their styles without even thinking about it.
- Host: GitHub
- URL: https://github.com/WebReflection/lazytag
- Owner: WebReflection
- Created: 2019-04-08T21:04:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-23T14:27:28.000Z (over 5 years ago)
- Last Synced: 2024-07-18T08:46:42.144Z (4 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 39
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lazytag
Lazy loading Custom Elements and their styles without even thinking about it.
```html
// you can have many lazyTag invokes per page
lazyTag({
// an optional *Array* of custom elements names or RegExp
// to consider: any other custom element will be ignored
only: [/^io-/],
// an optional *Array* of custom elements to ignore
// if `only` is used, this list is ignored
ignore: ['third-parts', 'pre-loaded', /-heresy$/],
// the optional JS path where component-name.js is
js: './components/js',
// the optional CSS path where component.name.css is
css: './components/css'
});
```
The previous example would load automatically `./components/js/my-component.js`, `./components/js/my-sub-component.js`, but also `./components/css/my-component.css` and `./components/css/my-sub-component.css`.
[Live test](https://webreflection.github.io/lazytag/test/).