|
|
|
@ -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(), |
|
|
|
|
], |
|
|
|
|
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()
|
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|