UNPKG

734 BJavaScriptView Raw
1import path from "path";
2import nodeResolve from "rollup-plugin-node-resolve";
3import commonjs from "rollup-plugin-commonjs";
4
5import base from "./rollup.config.base.json";
6
7import headerComment from "./HeaderCommentPlugin";
8import topLevelOptions from "./TopLevelOptionsPlugin";
9import readme from "./ReadmePlugin";
10import getHacks from "./getHacks";
11
12const sharedOptions = {
13 ...base,
14 plugins: [
15 nodeResolve(),
16 commonjs(),
17 readme(),
18 headerComment(),
19 topLevelOptions(),
20 ],
21};
22
23export default getHacks().map(input => ({
24 ...sharedOptions,
25 input,
26 output: {
27 ...sharedOptions.output,
28 file: `./dist/${path.basename(input).replace(/\s/g,'-')}`,
29 name: `hacks.${path.basename(input, '.js').replace(/\s/g,'_')}`,
30 },
31}));