Core Definitions

Core definitions can be placed at the top level of Modulo code. That is to say, the definitions listed here (Artifact, Component, Configuration, and Library) can all be defined at the top level of file loaded by Modulo or Library, or embedded directly within a Modulo tag in the <head> of the document. Typically, documentation on this page is most useful when you want to dig into configuring Modulo to behave a certain way across multiple pages, or interacting with other frameworks and versions.

Which ones to use? Most users of Modulo will use the Component definition the most. The other definitions listed here are useful most when you want to extend Modulo with custom JavaScript behavior, or integrate with third party code.

The outermost core definition

The outermost definition is always Modulo -- this is what "kicks off" the entire project. This is the <script Modulo ... or the <template Modulo> you might see at the top of a Modulo project.

The next core definitions

After that, most Modulo projects will have one or more of the following definitions, along with a summary of each:

  1. Configuration - (Extending or configuring Modulo and including third-party JavaScript libraries)
  2. Library - (Importing component libraries with non-conflicting namespaces or aliases)
  3. Artifact - (Customizing build behavior or specifying additional build artifacts)
  4. Component - (Registering web components, each in turn comprising of a collection of component parts)

Conventionally, they are typically listed in the order supplied above, although in some situations you might find it necessary to change the ordering because of sepcific needs, since Modulo processes definitions from top-to-bottom (e.g., the Configuration tags behave much like how the browser processes <script> tags in an HTML document).