Global Dependencies
Global dependencies in Elemental CMS are resources that your web application needs across multiple pages. Unlike modern bundling systems that combine everything into massive files, we follow a clean, direct approach where each dependency is a separate, focused file loaded directly without bundling or minification.
Understanding Global Dependencies #
Global dependencies are organized by type in separate folders:
Creating Dependencies #
CSS Dependencies
Create a CSS dependency with a clear, direct reference:
JavaScript Dependencies
JavaScript dependencies follow the same direct approach:
ES6 Modules
Modern JavaScript modules are handled directly:
Managing Dependencies #
Available Commands
Backup System #
When updating existing dependencies, the system automatically creates backups:
Best Practices #
Keep Dependencies Separate
- One file per dependency
- No bundling or minification
- Direct file references
Organize by Purpose
- Use meaningful file names
- Group by type (css/js/module)
- Maintain clear folder structure
Loading Order
- Use order field for dependencies
- Load CSS before JavaScript
- Keep dependencies focused
Examples #
Basic Stylesheet
JavaScript Library
ES6 Module
This approach ensures your application remains maintainable and clear, without unnecessary complexity or build steps. Each resource is loaded directly and serves a specific purpose.