Browse Source

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

es6
Treecat 2 years ago
parent
commit
e39339336e
  1. 54
      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

54
rollup.config.js

@ -2,38 +2,64 @@ const babel = require("@rollup/plugin-babel");
const alias = require("@rollup/plugin-alias"); const alias = require("@rollup/plugin-alias");
const resolve = require("@rollup/plugin-node-resolve"); const resolve = require("@rollup/plugin-node-resolve");
const commonjs = require("@rollup/plugin-commonjs"); const commonjs = require("@rollup/plugin-commonjs");
const sizes = require("rollup-plugin-sizes");
const path = require("path"); const path = require("path");
/**
* todo: 删除根目录下的 babel.config.js然后移入到这个文件
*/
const input = "src/index.js";
module.exports = [ module.exports = [
{ {
input, input: path.resolve(__dirname, "src/index.js"),
output: [ output: [
{ {
file: "dist/fineui.esm.js", file: "dist/fineui.esm.js",
format: "esm", format: "esm",
sourcemap: true, sourcemap: true,
}, }
], ],
plugins: [ plugins: [
alias({ alias({
entries: [ entries: [
{ find: "@", replacement: path.resolve(__dirname, "src") }, { find: "@", replacement: path.resolve(__dirname, "src") }
], ]
}), }),
resolve(), resolve(),
babel({ babel({
babelHelpers: "inline", babelHelpers: "inline",
plugins: [ plugins: [
["@babel/plugin-proposal-decorators", { legacy: true }], ["@babel/plugin-proposal-decorators", { legacy: true }]
], ]
}), }),
commonjs(), 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; freeExports._ = lodash;
} else { } else {
// Export to the global object. // Export to the global object.
BI._ = lodash; // BI._ = lodash;
} }
}.call(this)); }.call(this));

1
src/widget/index.js

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

6
webpack/attachments.js

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

18
webpack/webpack.common.js

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

Loading…
Cancel
Save