-
-
Notifications
You must be signed in to change notification settings - Fork 292
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
executable file
·50 lines (48 loc) · 1.03 KB
/
rollup.config.mjs
File metadata and controls
executable file
·50 lines (48 loc) · 1.03 KB
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
47
48
49
50
import rollupReplace from '@rollup/plugin-replace';
import rollupTypescript from '@rollup/plugin-typescript';
import dts from 'rollup-plugin-dts';
import typescript from 'typescript';
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');
const license = `/*!
* ${ pkg.name }
* https://github.com/${ pkg.repository }
* (c) 2017 @yomotsu
* Released under the MIT License.
*/`;
export default [
{
input: 'src/index.ts',
output: [
{
format: 'es',
file: pkg.module,
banner: license,
indent: '\t',
exports: 'named',
},
{
format: 'cjs',
file: pkg.main,
banner: license,
indent: '\t',
exports: 'named',
}
],
plugins: [
rollupReplace( { preventAssignment: true, __VERSION: pkg.version } ),
rollupTypescript( { typescript, declaration: false } ),
],
},
{
input: 'src/index.ts',
output: {
file: pkg.types,
format: 'es',
},
plugins: [
dts( { compilerOptions: { preserveSymlinks: false } } ),
],
}
];