forked from mysticatea/eslint-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
28 lines (26 loc) · 829 Bytes
/
rollup.config.js
File metadata and controls
28 lines (26 loc) · 829 Bytes
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.
*/
import sourcemaps from "rollup-plugin-sourcemaps"
import packageInfo from "./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),
}
}
export default [config(".js"), config(".mjs")]