{"size": 1396, "ext": "js", "max_stars_repo_path": "packages/af-virtual-scroll/rollup.config.prod.js", "max_stars_repo_name": "nowaalex/af-virtual-scroll", "max_stars_repo_stars_event_min_datetime": "2020-03-17T15:44:18.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-21T11:55:34.000Z", "max_issues_repo_path": "packages/af-virtual-scroll/rollup.config.prod.js", "max_issues_repo_name": "nowaalex/af-virtual-scroll", "max_issues_repo_issues_event_min_datetime": "2020-08-06T07:18:59.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T18:04:13.000Z", "max_forks_repo_path": "packages/af-virtual-scroll/rollup.config.prod.js", "max_forks_repo_name": "nowaalex/af-virtual-scroll", "max_forks_repo_forks_event_min_datetime": "2020-05-08T17:13:42.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-27T00:41:10.000Z"}
{"max_stars_count": 37, "max_issues_count": 18, "max_forks_count": 3, "avg_line_length": 32.4651162791, "max_line_length": 91, "alphanum_fraction": 0.5315186246}
import fs from "fs";
import replace from "@rollup/plugin-replace";
import virtual from "@rollup/plugin-virtual";
import fileSize from "rollup-plugin-filesize";
import { terser } from "rollup-plugin-terser";
import commonConfig from "./rollup.config.js";

const BUNDLE_TREESHAKE_STATS_OUTPUT_DIR = "treeshake_bundles";
fs.rmSync( BUNDLE_TREESHAKE_STATS_OUTPUT_DIR, { recursive: true, force: true });

export default [
    commonConfig,
    ...[
        [ "list", `import { List } from "./lib/index.esm.js";List();` ],
        [ "table", `import { Table } from "./lib/index.esm.js";Table();` ],
        [ "listTable", `import { List, Table } from "./lib/index.esm.js";List();Table();` ]
    ].map(([ fileName, fileContent ]) => ({
        input: fileName,
        treeshake: {
            moduleSideEffects: "no-external"
        },
        plugins: [
            virtual({
                [fileName]: fileContent
            }),
            replace({
                preventAssignment: true,
                "process.env.NODE_ENV": JSON.stringify( "production" )
            }),
            terser({
                output: {
                    beautify: false
                }
            }),
            fileSize()
        ],
        output: {
            format: "es",
            file: `${BUNDLE_TREESHAKE_STATS_OUTPUT_DIR}/${fileName}.js`,
            preferConst: true
        }
    }))
];