forked from snowplow/snowplow-javascript-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
24 lines (21 loc) · 763 Bytes
/
Copy pathrollup.config.js
File metadata and controls
24 lines (21 loc) · 763 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
import ts from 'rollup-plugin-ts'; // Prefered over @rollup/plugin-typescript as it bundles .d.ts files
import json from '@rollup/plugin-json';
import { banner } from '../../banner';
import pkg from './package.json';
import { builtinModules } from 'module';
export default [
// CommonJS (for Node) and ES module (for bundlers) build.
{
input: 'src/index.ts',
external: [...builtinModules, ...Object.keys(pkg.dependencies), ...Object.keys(pkg.devDependencies)],
plugins: [
json(),
ts({ browserslist: false }), // so Rollup can convert TypeScript to JavaScript
banner(true),
],
output: [
{ file: pkg.main, format: 'cjs', sourcemap: true },
{ file: pkg.module, format: 'es', sourcemap: true },
],
},
];