Browse Source

KERNEL-14512 refact: 修复一些细节问题

es6
Treecat 2 years ago
parent
commit
e39339336e
  1. 52
      rollup.config.js
  2. 2
      src/core/1.lodash.js
  3. 1
      src/widget/index.js
  4. 6
      webpack/attachments.js
  5. 18
      webpack/webpack.common.js

52
rollup.config.js

@ -2,38 +2,64 @@ const babel = require("@rollup/plugin-babel");
const alias = require("@rollup/plugin-alias");
const resolve = require("@rollup/plugin-node-resolve");
const commonjs = require("@rollup/plugin-commonjs");
const sizes = require("rollup-plugin-sizes");
const path = require("path");
/**
* todo: 删除根目录下的 babel.config.js然后移入到这个文件
*/
const input = "src/index.js";
module.exports = [
{
input,
input: path.resolve(__dirname, "src/index.js"),
output: [
{
file: "dist/fineui.esm.js",
format: "esm",
sourcemap: true,
},
}
],
plugins: [
alias({
entries: [
{ find: "@", replacement: path.resolve(__dirname, "src") },
],
{ find: "@", replacement: path.resolve(__dirname, "src") }
]
}),
resolve(),
babel({
babelHelpers: "inline",
plugins: [
["@babel/plugin-proposal-decorators", { legacy: true }],
["@babel/plugin-proposal-decorators", { legacy: true }]
]
}),
commonjs()
]
},
{
input: path.resolve(__dirname, "src/bundle.js"),
output: [
{
file: "dist/fineui.min.js",
sourcemap: true,
format: "umd"
}
],
plugins: [
alias({
entries: [
{ find: "@", replacement: path.resolve(__dirname, "src") }
]
}),
resolve(),
babel({
babelHelpers: "inline",
plugins: [
["@babel/plugin-proposal-decorators", { legacy: true }]
]
}),
// babel({
// babelHelpers: "runtime",
// presets: [babelConfig]
// }),
commonjs(),
],
},
sizes(),
// terser()
]
}
];

2
src/core/1.lodash.js

@ -10356,6 +10356,6 @@
freeExports._ = lodash;
} else {
// Export to the global object.
BI._ = lodash;
// BI._ = lodash;
}
}.call(this));

1
src/widget/index.js

@ -1,4 +1,5 @@
export { Collapse } from "./collapse/collapse";
export { SelectTreeExpander } from "./selecttree/selecttree.expander";
export { SelectTreeCombo } from "./selecttree/selecttree.combo";
export { SingleTreeCombo } from "./singletree/singletree.combo";
export { MultiTreeCombo } from "./multitree/multi.tree.combo";

6
webpack/attachments.js

@ -18,9 +18,9 @@ const basicAttachmentMap = {
core: sync([
"src/less/core/**/*.less",
"src/less/theme/**/*.less",
lodashJs,
jqueryJs,
popperJs,
// lodashJs,
// jqueryJs,
// popperJs,
"src/core/conflict.js",
"src/bundle.js",
// "src/core/**/*.js",

18
webpack/webpack.common.js

@ -63,15 +63,15 @@ module.exports = {
},
],
},
{
test: /\.js$/,
include: [path.resolve(__dirname, '../', attachments.lodash)],
use: [
{
loader: 'script-loader',
},
],
},
// {
// test: /\.js$/,
// include: [path.resolve(__dirname, '../', attachments.lodash)],
// use: [
// {
// loader: 'script-loader',
// },
// ],
// },
{
test: path.resolve(__dirname, '../', attachments.fix),
use: [

Loading…
Cancel
Save