|
@@ -2,6 +2,7 @@
|
|
|
const fs = require('fs');
|
|
|
const path = require('path');
|
|
|
const { execSync } = require('child_process');
|
|
|
+const { rmSync } = require('fs');
|
|
|
|
|
|
// 计算各路径
|
|
|
const rootDir = path.join(__dirname, '..'); // 项目根目录
|
|
@@ -9,6 +10,7 @@ const cordovaPrjDir = path.join(__dirname, 'dros'); // .build/dros
|
|
|
const srcDir = path.join(rootDir, 'dist', 'h5'); // ../dist/h5
|
|
|
const dstDir = path.join(cordovaPrjDir, 'www');
|
|
|
|
|
|
+rmSync('.build/dros', { recursive: true, force: true });
|
|
|
// 1. 在项目根目录执行 cordova create
|
|
|
execSync('npx cordova create .build/dros', { cwd: rootDir, stdio: 'inherit' });
|
|
|
|