|
|
@ -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() |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
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(), |
|
|
|
commonjs(), |
|
|
|
], |
|
|
|
sizes(), |
|
|
|
}, |
|
|
|
// terser()
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
]; |
|
|
|
]; |
|
|
|