-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
executable file
·27 lines (24 loc) · 920 Bytes
/
rollup.config.js
File metadata and controls
executable file
·27 lines (24 loc) · 920 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
#!rollup --config
import babelPresetTypescript from "@babel/preset-typescript"
import { babel } from "@rollup/plugin-babel"
import { nodeResolve } from "@rollup/plugin-node-resolve"
import { findFiles } from "@samual/lib/findFiles"
/** @typedef {import("rollup").RollupOptions} RollupOptions */
const SOURCE_FOLDER = "src"
/** @type {RollupOptions} */ export default {
input: Object.fromEntries(
(await findFiles(SOURCE_FOLDER)).filter(path => path.endsWith(".ts") && !path.endsWith(".d.ts"))
.map(path => [ path.slice(SOURCE_FOLDER.length + 1, -3), path ])
),
output: {
dir: "dist",
sourcemap: true,
sourcemapPathTransform: relativeSourcePath => relativeSourcePath.slice(2)
},
plugins: [
nodeResolve({ extensions: [ ".ts" ] }),
babel({ babelHelpers: "bundled", extensions: [ ".ts" ], presets: [ babelPresetTypescript ] })
],
strictDeprecations: true,
treeshake: { moduleSideEffects: false }
}