@c-time/frelio-data-json-recipe-to-dependency-map (英语)
页:1FrelioBuildDataRecipe) FrelioDependencyMapを生成する変換ライブラリ。
(单位:千美元)
ビルドレシピを解析し、各出力ファイルがどのソースファイルに依存しているかを自動算出する。これにより、コンテンツやテンプレートの変更時に差分ビルドが可能になる。
解析対象:
- コンテンツタイプの詳細ページ・一覧ページのテンプレート依存
expand页:1customFieldsによる関連コンテンツタイプへの依存- リレーションフィールドのターゲットへの依存
- テンプレートインクルード(パーシャル)の依存伝播
インストール
npm install @c-time/frelio-data-json-recipe-to-dependency-map
使用例
import { convertRecipeToDependencyMap } from '@c-time/frelio-data-json-recipe-to-dependency-map'
import type { FrelioBuildDataRecipe } from '@c-time/frelio-data-json-recipe'
import type { ContentType } from '@c-time/frelio-types'
const recipe: FrelioBuildDataRecipe = {
contentTypes: { /* ... */ },
staticPages: [],
templateIncludes: {},
}
// コンテンツタイプ定義を渡すと、リレーションフィールドの依存も解析される
const contentTypeDefinitions = new Map<string, ContentType>([
['news', { id: 'news', fields: [/* ... */] }],
])
const dependencyMap = convertRecipeToDependencyMap(recipe, {
contentTypeDefinitions,
})
API 密码
convertRecipeToDependencyMap(recipe, options?)
ビルドレシピから依存マップを生成する。
| パラメータ | 页:1 | 説明 |
|---|---|---|
recipe | FrelioBuildDataRecipe | ビルドレシピ |
options.contentTypeDefinitions | Map<string, ContentType> | 页:1 |
戻り値数字 : FrelioDependencyMap
依存パッケージ
@c-time/frelio-data-json-recipe. . . . .@c-time/frelio-dependency-map. . . . .@c-time/frelio-types. . . . .
ライセンス
麻省理工学院