diff --git a/PackageStructureKit/hvigorfile.ts b/PackageStructureKit/hvigorfile.ts index e1edb358a8bed335f6f381a3aae3077223c9538d..5dc2a3e02e3cb7e0d74fc18b9134e20a2ab60f15 100644 --- a/PackageStructureKit/hvigorfile.ts +++ b/PackageStructureKit/hvigorfile.ts @@ -14,16 +14,15 @@ */ // [Start hvigorfile] -import { hapTasks, OhosPluginId } from '@ohos/hvigor-ohos-plugin'; -import { hapPlugin } from '@hadss/hmrouter-plugin'; -import { hvigor } from '@ohos/hivgor'; -import fs from 'fs'; -import path from 'path'; +import { appTasks } from '@ohos/hvigor-ohos-plugin'; +import { hvigor } from '@ohos/hvigor'; +import * as fs from 'fs'; +import * as path from 'path'; // Callback function after node evaluation hvigor.afterNodeEvaluate((hvigorNode) => { // Ensure this directory exists - const resourcesDir = path.join(__dirname, 'src/main/resources/rawfile'); + const resourcesDir = path.join(__dirname, 'entry/src/main/resources/rawfile'); if (!fs.existsSync(resourcesDir)) { fs.mkdirSync(resourcesDir, { recursive: true }); } @@ -32,19 +31,19 @@ hvigor.afterNodeEvaluate((hvigorNode) => { const now = new Date(); const buildTime = now.getFullYear() + '-' + String(now.getMonth() + 1).padStart(2, '0') + '-' - + String(now.getDate()).padStart(2, '0') + '' + + String(now.getDate()).padStart(2, '0') + ' ' + String(now.getHours()).padStart(2, '0') + ':' + String(now.getMinutes()).padStart(2, '0') + ':' + String(now.getSeconds()).padStart(2, '0'); const buildInfo = { 'buildTime': buildTime }; fs.writeFileSync( - path.join(resourceDir, 'build_info.json'), + path.join(resourcesDir, 'build_info.json'), JSON.stringify(buildInfo, null, 2) ); }) export default { - system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins: [hapPlugin()] /* Custom plugin to extend the functionality of Hvigor. */ + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ } // [End hvigorfile] \ No newline at end of file