https://github.com/genesys/modkit-loader
Runtime Module Loader
https://github.com/genesys/modkit-loader
amd code-splitting esm iife javascript loader modkit modkit-loader module requirejs runtime system systemjs typescript umd
Last synced: 11 days ago
JSON representation
Runtime Module Loader
- Host: GitHub
- URL: https://github.com/genesys/modkit-loader
- Owner: genesys
- License: mit
- Created: 2021-02-08T09:10:01.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T10:02:41.000Z (almost 2 years ago)
- Last Synced: 2025-10-27T01:23:22.516Z (9 months ago)
- Topics: amd, code-splitting, esm, iife, javascript, loader, modkit, modkit-loader, module, requirejs, runtime, system, systemjs, typescript, umd
- Language: JavaScript
- Homepage: https://genesys.github.io/modkit-loader/
- Size: 33.3 MB
- Stars: 3
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Modkit Loader
[](https://sonarcloud.io/dashboard?id=genesys_modkit-loader)
[](https://sonarcloud.io/dashboard?id=genesys_modkit-loader)
[](https://www.npmjs.com/package/modkit-loader)
[](https://www.npmjs.com/package/modkit-loader)
[](https://github.com/cadgerfeast/modkit-loader/blob/master/LICENSE)
`Modkit Loader` is a customization library that allows you to add modules to your application, at runtime.
## Documentation
[Full documentation website can be found here.](https://genesys.github.io/modkit-loader/)
## Installation
### With any web UI Framework
``` bash
# Install the dependency
npm install modkit-loader --save
```
``` javascript
// Javascript
const Modkit = require('modkit-loader');
```
``` typescript
// ES6 or TypeScript
import * as Modkit from 'modkit-loader';
```
### With CDN
As `Modkit Loader` uses **code-splitting**, we cannot bundle the library as a standard **UMD** build.
With modern browsers, that's not an issue, but when targeting IE11, you'll need something more.
``` html
import * as Modkit from 'https://unpkg.com/modkit-loader/dist/module/index.js';
// Modkit is available
System.import('https://unpkg.com/modkit-loader/dist/system/index.js').then(function (Modkit) {
// Modkit is available
});
```
## Usage
### Load a module
Once the Modkit Singleton is imported, you can load a module:
``` javascript
Modkit.load('/path/to/my-module/manifest.json')
.then((m) => {
// Here, "m" is an object containing all manifest properties along with other computed properties
m.mod // This is the module itself
m.rootPath // This is the root path to the module build, that is helpful for static assets
});
```
## Features
* Dynamically load packages at runtime, supporting all formats via a single `load` method.
* Will automatically load what is needed depending on the module format ([require.js](https://requirejs.org/) for amd modules, [system.js](https://github.com/systemjs/systemjs) for system modules).
* Has module manifest validation (global and on-load)
* Supports module dependencies (libraries or other modules), with [semver](https://semver.org/) versioning for compatibility.
## License
- **[MIT license](http://opensource.org/licenses/mit-license.php)**
- Copyright 2021 © [Genesys](https://www.genesys.com/).