Skip to content

Commit 06a57db

Browse files
authored
feat: IDE打轻卡正式包不包含js文件 (#132)
Signed-off-by: lilei946 <[email protected]>
1 parent 1a9ea7a commit 06a57db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ 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) {
39+
// 非 IDE 打轻卡包或者 IDE 打正式轻卡包
3840
if (
39-
originType !== compileOptionsMeta.originTypeNum.IDE &&
41+
(originType !== compileOptionsMeta.originTypeNum.IDE || !isDevMode) &&
4042
liteEntryFiles.indexOf(fileName) >= 0
4143
) {
4244
delete compilation.assets[fileName] // delete bundle js for lite card

0 commit comments

Comments
 (0)