Skip to content

Commit 4c3b44b

Browse files
xingfujiang72161674
andauthored
修复dist目录打包覆盖问题 (#39)
Co-authored-by: 72161674 <[email protected]>
1 parent de860f4 commit 4c3b44b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

__tests__/examples/sample.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,9 @@ describe('hap-toolkit', () => {
153153
}
154154
})
155155
expect(sourceArr.join('\n\n')).toMatchSnapshot(identifierArr.join('\n\n'))
156-
157156
const rpks = await lsfiles('dist/*.rpk', { cwd })
158-
const hasCustom = rpks[0].indexOf('dev') !== -1
157+
const hasCustom = rpks.some((item) => item.indexOf('dev') !== -1)
159158
expect(hasCustom).toBeTruthy()
160-
161159
expect(json.assets.map((a) => a.name).sort()).toMatchSnapshot('assets list')
162160
const output = stripAnsi(outputs.join('\n'))
163161
// TODO expect(wipe(output)).toMatchSnapshot('outputs')

packages/hap-toolkit/src/gen-webpack-conf/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function cleanup(BUILD_DIR, DIST_DIR) {
3838
zipfiles.forEach(function (file) {
3939
const curPath = DIST_DIR + '/' + file
4040
if (fs.statSync(curPath).isFile()) {
41-
fs.unlinkSync(curPath)
41+
// fs.unlinkSync(curPath)
4242
}
4343
})
4444
}

0 commit comments

Comments
 (0)