INNER CODE UNIT · TypeScript

writeMeta

reactnativecn/react-native-update · harmony/hvigor-plugin.ts:146

      const writeMeta = (taskContext?: HvigorTaskContext) => {
        const buildMode = resolveBuildMode(safeNode, taskContext, argv);
        const metaFilePath = path.resolve(moduleDir, META_RELATIVE_PATH);
        fs.mkdirSync(path.dirname(metaFilePath), { recursive: true });
        const metaContent = buildMetaContent(
          buildMode,
          readVersionName(projectDir),
          Date.now(),
        );
        fs.writeFileSync(metaFilePath, JSON.stringify(metaContent, null, 2));
        console.log(`Build time written to ${metaFilePath} (${buildMode})`);
      };

      if (typeof safeNode.registerTask === 'function') {
        try {
          safeNode.registerTask({
            name: TASK_NAME,
            run: writeMeta,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…