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

28
webpack/components.js

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

Loading…
Cancel
Save