提交 73121145 编写于 作者: J JiM-W

修复extra配置不生效bug

上级 4f7204b9
......@@ -10,6 +10,7 @@ const path = require('path');
const fs = require('fs');
const crypto = require('crypto');
const cmlUtils = require('chameleon-tool-utils');
/**
* 非web端构建
* @param {*} media dev or build ...
......@@ -212,13 +213,13 @@ exports.createConfigJson = function() {
let configObj = {};
if (cml.utils.isFile(configJsonPath)) {
configObj = JSON.parse(fs.readFileSync(configJsonPath, {encoding: 'utf-8'}))
};
}
// 获取weex jsbundle地址
let weexjs = configObj.weexjs || '';
let md5str = '';
const weexjsName = weexjs.split('/').pop();
const weexjsPath = path.resolve(cml.projectRoot, 'dist/weex/', weexjsName);
if (cml.utils.isFile(weexjsPath)) {
const md5sum = crypto.createHash('md5');
const buffer = fs.readFileSync(weexjsPath);
......@@ -327,7 +328,7 @@ exports.createConfigJson = function() {
result.forEach(item => {
Object.keys(item).forEach(key => {
if (!~cml.activePlatform.indexOf(key)) {
if (!~cml.activePlatform.indexOf(key) && key !== 'extra') {
delete item[key]
}
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册