forked from rayou/cdk-url-shortener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
46 lines (44 loc) · 1.18 KB
/
rollup.config.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import path from 'path';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import builtins from 'builtin-modules';
import { terser } from 'rollup-plugin-terser';
import del from 'rollup-plugin-delete';
const SOURCE_PATH = 'src/lambda-fns/shorten/';
const DIST_PATH = 'lib/lambda-fns/shorten/';
export default {
input: path.join(__dirname, SOURCE_PATH, 'index.ts'),
output: {
dir: DIST_PATH,
format: 'cjs',
sourcemap: false,
},
external: [...builtins, 'aws-sdk', 'aws-lambda'],
plugins: [
del({
targets: DIST_PATH,
verbose: true,
}),
resolve({
preferBuiltins: true,
extensions: ['.mjs', '.js', '.jsx', '.json', '.ts'],
}),
commonjs(),
typescript({
typescript: require('typescript'),
include: ['src/lambda-fns/**/*.ts'],
tsconfigOverride: {
compilerOptions: {
allowSyntheticDefaultImports: true,
declaration: false,
inlineSourceMap: false,
inlineSources: false,
module: 'ES2015',
outDir: DIST_PATH,
},
},
}),
terser(),
],
};