Create a Modular Template
To create a Modular Template, start with any Modular package type for which you want to create a template for (app, package, etc). The package’s contents will be copied into any new package created using the template.
To convert the package into a template, make the following changes to the package’s package.json:
- Change
modular.typefield to"template" - Optionally add
modular.templateTypewith the desired target package type. Ifmodular.templateTypeis not present, the target package will not have amodularfield in itspackages.json.
Example configuration for a template that generates esm-views.
{
"modular": {
"type": "template",
"templateType": "esm-view"
}
}
Optionally, include a files array pattern containing any files that Modular should include from the template when creating a new package using it. Example:
{
"files": [
"path/to/file-to-include-1.tsx",
"path/to/file-to-include-2.ts",
"folder-to-include"
]
}
If not specified, Modular will include all files.