Interface Module

Interface describing the shape of a Module while being aligned with well-known package.json fields. This interface additionally specifies optional sgrudDependencies and webDependencies mappings, which both are used by the Kernel to determine SGRUD module dependencies and runtime dependencies.

Example

An exemplary Module definition:

import { type Kernel } from '@sgrud/core';

const module: Kernel.Module = {
name: 'module',
version: '0.0.0',
exports: './module.exports.js',
unpkg: './module.unpkg.js',
sgrudDependencies: {
sgrudDependency: '^0.0.1'
},
webDependencies: {
webDependency: {
exports: {
webDependency: './webDependency.exports.js'
},
unpkg: [
'./webDependency.unpkg.js'
]
}
}
};
interface Module {
    digest?: Record<string, Digest>;
    exports?: string;
    name: string;
    sgrudDependencies?: Record<string, string>;
    unpkg?: string;
    version: string;
    webDependencies?: Record<string, WebDependency>;
}

Properties

digest?: Record<string, Digest>

Optional bundle Digests. If hashes are supplied, they will be used to verify the Subresource Integrity of the respective bundles.

exports?: string

Optional ESM entry point.

name: string

The name of the Module.

sgrudDependencies?: Record<string, string>

Optional SGRUD Module dependencies.

unpkg?: string

Optional UMD entry point.

version: string

The Module version, formatted as according to the semver specifications.

webDependencies?: Record<string, WebDependency>

Optional WebDependency mapping.

Generated using TypeDoc