-
Notifications
You must be signed in to change notification settings - Fork 48
Module Loader
Lazo leverages a custom module loader, which is referenced prefixing a module id or path with a l!
.
define(['l!app/server/some_module', 'l!app/client/some_module'], function (m1, m2) {
// on the client m1 will be null
// on the server m2 will be null
});
The loader no-ops server modules on the client and vice versa on the server. Additionally, it makes
attempts to resolve relative Node module paths to the application
baseUrl
in the event that they cannot be resolved
in the standard fashion. The no-op and resolution logic is based on
directory naming conventions, i.e., server
, client
, and node_modules
. The loader will inspect both
the module ID and path for these directories.
It is best practice to always use the loader regardless of whether code is shared between the client and the server.
Overview
Life Cycles
Getting Started
Development Tools
Application Structure
application.js
Configuration
Configuration Providers
Logging
Module Loader
Assets
Combo Handling
Components
Models and Collections
Views
Templates
Layouts
Imports
Links
Request Filters
Crumb
Server Setup
Error Templates
Page Template
Server Utilities
Node Modules
Contributing