@netvlies/wsc-js-moduleloader
v3.0.0
Published
module loader to be imported in skeletons
Readme
wsc-moduleloader
The purpose of this module is to abstract the module loader and base module components so they can be implemented independently.
Setup
The module can be installed by running:
npm i -D @netvlies/wsc-js-moduleloader
Usage
Create custom modules in your HTML using a web component (default: <nvs-module>). It is best-practice to prefix them with nvs for readability and consistency throughout our projects.
<nvs-nav>
<ul>...</ul>
</nvs-nav>Loop through your custom webcomponents in your source code using this setup:
import Nav from './modules/Nav';
const webComponents = [Nav];
for (const { element, module } of webComponents) {
customElements.define(element, module);
}Create the modules using the default framework in the [Base module] which can be found in the lib folder.
<nvs-nav>
<ul>...</ul>
</nvs-nav>