1 | import path from "path";
|
2 | import nodeResolve from "rollup-plugin-node-resolve";
|
3 | import commonjs from "rollup-plugin-commonjs";
|
4 |
|
5 | import base from "./rollup.config.base.json";
|
6 |
|
7 | import headerComment from "./HeaderCommentPlugin";
|
8 | import topLevelOptions from "./TopLevelOptionsPlugin";
|
9 | import readme from "./ReadmePlugin";
|
10 | import getHacks from "./getHacks";
|
11 |
|
12 | const sharedOptions = {
|
13 | ...base,
|
14 | plugins: [
|
15 | nodeResolve(),
|
16 | commonjs(),
|
17 | readme(),
|
18 | headerComment(),
|
19 | topLevelOptions(),
|
20 | ],
|
21 | };
|
22 |
|
23 | export 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 | }));
|