@ttmg/cli 0.3.1-unity.10 → 0.3.1-unity.13

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.
@@ -12,7 +12,7 @@
12
12
  rel="stylesheet"
13
13
  />
14
14
  <title>TikTok Mini Games DevTool</title>
15
- <script type="module" crossorigin src="/assets/index-SqdluTsf.js"></script>
15
+ <script type="module" crossorigin src="/assets/index-YhxvkywD.js"></script>
16
16
  <link rel="stylesheet" crossorigin href="/assets/index-sCifET6h.css">
17
17
  </head>
18
18
  <body>
@@ -100,15 +100,13 @@ async function compile(context = {}) {
100
100
 
101
101
  parentPort?.postMessage({ type: 'status', status: 'start' });
102
102
 
103
- const outputTempDir = path.join(
104
- entryDir,
105
- '__TTMG_TEMP__',
106
- clientKey + '_compile_' + Date.now().toString(),
107
- );
103
+ if (fs.existsSync(outputDir)) {
104
+ fs.rmSync(outputDir, { recursive: true, force: true });
105
+ }
108
106
  // 调用打包
109
107
  const { isSuccess, errorMsg, packages } = await debugPkgs({
110
108
  entry: entryDir,
111
- output: outputTempDir,
109
+ output: outputDir,
112
110
  dev: {
113
111
  enable: true,
114
112
  port: devPort,
@@ -127,15 +125,6 @@ async function compile(context = {}) {
127
125
  // spawnOptions: { stdio: ['ignore', 'pipe', 'pipe'] },
128
126
  // concurrency: 4,
129
127
  });
130
- if (fs.existsSync(outputDir)) {
131
- // 删除旧输出目录
132
- fs.rmSync(outputDir, { recursive: true, force: true });
133
- // 复制临时目录到输出目录
134
- // 直接替换 outputDir 内容,避免生成 __TTMG_TEMP__ 子目录
135
- fs.cpSync(outputTempDir, outputDir, { recursive: true });
136
- // 删除临时目录
137
- fs.rmSync(outputTempDir, { recursive: true, force: true });
138
- }
139
128
  if (fs.existsSync(path.join(outputDir, '__TTMG_TEMP__'))) {
140
129
  fs.rmSync(path.join(outputDir, '__TTMG_TEMP__'), {
141
130
  recursive: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttmg/cli",
3
- "version": "0.3.1-unity.10",
3
+ "version": "0.3.1-unity.13",
4
4
  "description": "TikTok Mini Game Command Line Tool",
5
5
  "license": "ISC",
6
6
  "bin": {