Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

16 Commits

Repository files navigation

lazytag

Lazy loading Custom Elements and their styles without even thinking about it.

<script>// you can have many lazyTag invokes per pagelazyTag({// an optional *Array* of custom elements names or RegExp// to consider: any other custom element will be ignoredonly: [/^io-/],// an optional *Array* of custom elements to ignore// if `only` is used, this list is ignoredignore: ['third-parts','pre-loaded',/-heresy$/],// the optional JS path where component-name.js isjs: './components/js',// the optional CSS path where component.name.css iscss: './components/css'});</script><my-component><my-sub-component></my-sub-component></my-component>

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.

About

Lazy loading Custom Elements and their styles without even thinking about it.

Resources

Stars

40 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages