File: rollup.config.js

package info (click to toggle)
node-eslint-utils 3.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 468 kB
  • sloc: javascript: 4,582; makefile: 28; sh: 1
file content (28 lines) | stat: -rw-r--r-- 841 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
 * @author Toru Nagashima
 * See LICENSE file in root directory for full license.
 */
const sourcemaps = require("rollup-plugin-sourcemaps")
const packageInfo = require("./package.json")

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

module.exports = [config(".js"), config(".mjs")]