Skip to content

Commit 8e75cdf

Browse files
committed
feat: IDE打轻卡正式包不包含js文件
Signed-off-by: lilei946 <snowinter2008@gmail.com>
1 parent 1a9ea7a commit 8e75cdf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/hap-packager/src/plugins/handler-plugin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ HandlerPlugin.prototype.apply = function (compiler) {
3333
const entryFiles = getEntryFiles(compiler.options.entry)
3434
const liteEntryFiles = getLiteEntryFiles(compiler.options.entry)
3535
const { originType } = compileOptionsObject || {}
36+
const isDevMode = globalConfig.mode === 'development'
3637
compilation.chunks.forEach(function (chunk) {
3738
chunk.files.forEach(function (fileName) {
3839
if (
39-
originType !== compileOptionsMeta.originTypeNum.IDE &&
40-
liteEntryFiles.indexOf(fileName) >= 0
40+
!isDevMode ||
41+
(originType !== compileOptionsMeta.originTypeNum.IDE &&
42+
liteEntryFiles.indexOf(fileName)) >= 0
4143
) {
4244
delete compilation.assets[fileName] // delete bundle js for lite card
4345
return

0 commit comments

Comments
 (0)