rollup.config.js
function config(ext) {
    return {
        input: "src/index.js",
        output: {
            file: `index${ext}`,
            format: ext === ".mjs" ? "es" : "cjs",
            sourcemap: true,
            sourcemapFile: `index${ext}.map`,
            strict: true,
            banner: `/*! @author Toru Nagashima <https://github.com/mysticatea> */`,
        },
        plugins: [sourcemaps()],
        external: Object.keys(require("./package.json").dependencies),
    }
}
function config(ext) {
    return {
        input: "src/index.js",
        output: {
            file: `index${ext}`,
            format: ext === ".mjs" ? "es" : "cjs",
            sourcemap: true,
            sourcemapFile: `index${ext}.map`,
            strict: true,
            banner: `/*! @author Toru Nagashima <https://github.com/mysticatea> */`,
        },
        plugins: [sourcemaps()],
        external: Object.keys(require("./package.json").dependencies),
    }
}
Define the output configuration.
@param {string} ext The extension for generated files.
@returns {object} The output configuration