@xingwangzhe/stalux 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +19 -9
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -190,15 +190,25 @@ export function stalux(options: StaluxOptions = {}): AstroIntegration {
|
|
|
190
190
|
logger.info(`Stalux initialized (contentDir: ${opt.contentDir})`);
|
|
191
191
|
},
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
193
|
+
"astro:build:start": async ({ logger }) => {
|
|
194
|
+
// 5. 每路由最小化字体裁剪(构建时)
|
|
195
|
+
try {
|
|
196
|
+
const projectRoot = process.cwd();
|
|
197
|
+
await runFontSubsetting(projectRoot, logger);
|
|
198
|
+
} catch (error) {
|
|
199
|
+
logger.warn(`Font subsetting skipped: ${String(error)}`);
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
"astro:server:setup": async ({ logger }) => {
|
|
204
|
+
// 6. 每路由最小化字体裁剪(开发模式)
|
|
205
|
+
try {
|
|
206
|
+
const projectRoot = process.cwd();
|
|
207
|
+
await runFontSubsetting(projectRoot, logger);
|
|
208
|
+
} catch (error) {
|
|
209
|
+
logger.warn(`Font subsetting skipped: ${String(error)}`);
|
|
210
|
+
}
|
|
211
|
+
},
|
|
202
212
|
|
|
203
213
|
"astro:build:done": async ({ dir, logger }) => {
|
|
204
214
|
// 6. 后处理:Pagefind 搜索索引
|