Browse Source

KERNEL-14241 refactor:调整js相关打包,用index.js替换blob语法

es6
Vivy.Pan 2 years ago
parent
commit
8420a4a74b
  1. 1
      src/widget/date/index.js
  2. 42
      webpack/attachments.js
  3. 28
      webpack/components.js

1
src/widget/date/index.js

@ -0,0 +1 @@
export * from "./calendar";

42
webpack/attachments.js

@ -13,7 +13,7 @@ const runtimePolyfill = ["@babel/polyfill", "es6-promise/auto"];
const basicAttachmentMap = { const basicAttachmentMap = {
polyfill: sync([ polyfill: sync([
"src/core/0.foundation.js", "src/core/0.foundation.js",
"src/polyfill/**/*.js", "src/polyfill/*.js",
]).concat(runtimePolyfill), ]).concat(runtimePolyfill),
core: sync([ core: sync([
"src/less/core/**/*.less", "src/less/core/**/*.less",
@ -44,16 +44,16 @@ const basicAttachmentMap = {
// "src/component/**/*.js", // "src/component/**/*.js",
]), ]),
router: sync([ router: sync([
"src/router/**/*.js", "src/router/*.js",
]), ]),
core_without_platform: sync([ core_without_platform: sync([
"src/core/0.foundation.js", "src/core/0.foundation.js",
lodashJs, lodashJs,
"src/core/**/*.js", "src/core/index.js",
"src/data/**/*.js", // "src/data/**/*.js",
], [ ], [
"src/core/platform/**/*.js", "src/core/platform/index.js",
"src/core/controller/**/*.js", "src/core/controller/index.js",
]), ]),
core_without_normalize: sync( core_without_normalize: sync(
["src/less/core/**/*.less", "src/less/theme/**/*.less"], ["src/less/core/normalize.less", "src/less/core/normalize2.less"] ["src/less/core/**/*.less", "src/less/theme/**/*.less"], ["src/less/core/normalize.less", "src/less/core/normalize2.less"]
@ -62,8 +62,8 @@ const basicAttachmentMap = {
"src/less/core/**/*.less", "src/less/core/**/*.less",
"src/less/theme/**/*.less", "src/less/theme/**/*.less",
lodashJs, lodashJs,
"src/core/**/*.js", "src/core/index.js",
"src/data/**/*.js", // "src/data/**/*.js",
], [ ], [
"src/core/conflict.js", "src/core/conflict.js",
]), ]),
@ -72,22 +72,22 @@ const basicAttachmentMap = {
ts: ['./typescript/bundle.ts'], ts: ['./typescript/bundle.ts'],
ui: sync([ ui: sync([
'ui/less/app.less', 'ui/less/app.less',
'ui/less/**/*.less', 'ui/less/*.less',
'ui/js/**/*.js', 'ui/js/index.js',
]), ]),
config: sync(["demo/version.js", "i18n/i18n.cn.js"]), config: sync(["demo/version.js", "i18n/i18n.cn.js"]),
utils: sync([ utils: sync([
"src/core/0.foundation.js", "src/core/0.foundation.js",
lodashJs, lodashJs,
"src/core/constant/**/*.js", "src/core/constant/index.js",
"src/core/func/**/*.js", "src/core/func/index.js",
"src/core/2.base.js", "src/core/2.base.js",
"src/core/3.ob.js", "src/core/3.ob.js",
"src/core/5.inject.js", "src/core/5.inject.js",
"src/core/utils/*.js", "src/core/utils/*.js",
"i18n/i18n.cn.js", "i18n/i18n.cn.js",
"_mobile/date.i18n.cn.js", "_mobile/date.i18n.cn.js",
"src/data/**/*.js", // "src/data/**/*.js",
]), ]),
fix: [fixJs], fix: [fixJs],
fixProxy: [fixProxyJs], fixProxy: [fixProxyJs],
@ -111,7 +111,7 @@ const bundle = [].concat(
sync(["public/less/app.less", "public/less/**/*.less"]), sync(["public/less/app.less", "public/less/**/*.less"]),
[fixCompact, workerCompact], [fixCompact, workerCompact],
basicAttachmentMap.router, basicAttachmentMap.router,
sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]), sync(["public/js/index.js", "public/js/index.js", "i18n/i18n.cn.js"]),
basicAttachmentMap.ts, basicAttachmentMap.ts,
); );
@ -139,7 +139,7 @@ const coreJs = [].concat(
const resource = sync(["private/less/app.less", "private/less/**/*.less"]); const resource = sync(["private/less/app.less", "private/less/**/*.less"]);
const config = sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]); const config = sync(["public/js/index.js", "public/js/index.js", "i18n/i18n.cn.js"]);
const bundleWithoutNormalize = [].concat( const bundleWithoutNormalize = [].concat(
basicAttachmentMap.core_without_normalize, basicAttachmentMap.core_without_normalize,
@ -219,21 +219,21 @@ const fineuiWithoutJqueryAndPolyfillJs = [].concat(
sync([ sync([
"src/core/0.foundation.js", "src/core/0.foundation.js",
lodashJs, lodashJs,
"src/core/**/*.js", "src/core/index.js",
"src/data/**/*.js", // "src/data/**/*.js",
], [ ], [
"src/core/platform/web/**/*.js", "src/core/platform/web/**/*.js",
]), ]),
basicAttachmentMap.fix, basicAttachmentMap.fix,
sync([ sync([
"src/base/**/*.js", "src/base/index.js",
"src/case/**/*.js", "src/case/index.js",
], [ ], [
"src/base/single/input/file.js", "src/base/single/input/file.js",
"src/case/ztree/**/*.js", "src/case/ztree/index.js",
]), ]),
basicAttachmentMap.widget, basicAttachmentMap.widget,
sync([fixCompact, workerCompact, "ui/js/**/*.js"]), sync([fixCompact, workerCompact, "ui/js/index.js"]),
basicAttachmentMap.ts, basicAttachmentMap.ts,
); );

28
webpack/components.js

@ -1,22 +1,22 @@
const { sync, uniq } = require("./utils"); const { sync, uniq } = require("./utils");
const basicAttachmentMap = { const basicAttachmentMap = {
single: sync(["src/base/single/**/*.js"]), single: sync(["src/base/single/index.js"]),
layer: sync(["src/base/layer/**/*.js"]), layer: sync(["src/base/layer/index.js"]),
pane: sync(["src/base/1.pane.js"]), pane: sync(["src/base/1.pane.js"]),
button_group: sync(["src/base/combination/group.button.js"]), button_group: sync(["src/base/combination/group.button.js"]),
buttons: sync(["src/case/button/**/*.js"]), buttons: sync(["src/case/button/index.js"]),
checkboxes: sync(["src/case/checkbox/**/*.js"]), checkboxes: sync(["src/case/checkbox/index.js"]),
combos: sync(["src/case/combo/**/*.js"]), combos: sync(["src/case/combo/index.js"]),
editors: sync(["src/case/editor/**/*.js"]), editors: sync(["src/case/editor/index.js"]),
triggers: sync(["src/case/trigger/**/*.js"]), triggers: sync(["src/case/trigger/index.js"]),
calendar: sync(["src/case/calendar/**/*.js"]), calendar: sync(["src/case/calendar/index.js"]),
color_chooser: sync(["src/case/colorchooser/**/*.js"]), color_chooser: sync(["src/case/colorchooser/index.js"]),
segment: sync(["src/case/segment/**/*.js"]), segment: sync(["src/case/segment/index.js"]),
linear_segment: sync(["src/case/linearsegment/**/*.js"]), linear_segment: sync(["src/case/linearsegment/index.js"]),
date: sync(["src/widget/date/**/*.js"]), date: sync(["src/widget/date/index.js"]),
down_list: sync(["src/widget/downlist/**/*.js"]), down_list: sync(["src/widget/downlist/index.js"]),
text_value_down_list_combo: sync(["src/widget/textvaluedownlistcombo/**/*.js"]), text_value_down_list_combo: sync(["src/widget/textvaluedownlistcombo/index.js"]),
}; };
module.exports = { module.exports = {

Loading…
Cancel
Save