forked from nacos-group/nacos-group.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruntime.js
More file actions
18 lines (15 loc) · 653 Bytes
/
runtime.js
File metadata and controls
18 lines (15 loc) · 653 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import fs from "fs/promises";
import path from "path";
import { fileURLToPath } from 'url';
const curFilename = fileURLToPath(import.meta.url);
const curDirname = path.dirname(curFilename);
const runtimePath = path.join(curDirname, 'node_modules/astro/dist/content/runtime.js');
/**
* @description: 替换 runtime.js中的 entries取值
*/
const originContent = await fs.readFile(runtimePath);
const replacedContent = originContent.toString().replace(
'if (!import.meta.env?.DEV && cacheEntriesByCollection.has(collection)) {',
'if (false && cacheEntriesByCollection.has(collection)) {'
);
await fs.writeFile(runtimePath, replacedContent);