forked from soimy/maxrects-packer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
33 lines (31 loc) · 890 Bytes
/
rollup.config.ts
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
import ts from 'rollup-plugin-ts';
import uglify from 'rollup-plugin-uglify-es';
import path from 'path';
const config = [
{
input: './src/index.ts',
// transpiled typescript in umd and es format
output: [
{ file: 'dist/maxrects-packer.js', name: 'MaxRectsPacker', format: 'umd', sourcemap: true },
{ file: 'dist/maxrects-packer.mjs', format: 'es', sourcemap: true }
],
plugins: [
ts({
tsconfig: (resolvedConfig) => {
const config = Object.assign({}, resolvedConfig);
config.declarationDir = path.join(__dirname, 'dist');
return config;
}
})
]
},
{
input: './src/index.ts',
// uglified transpiled typescript in commonjs
output: [
{ file: 'dist/maxrects-packer.min.js', format: 'cjs', sourcemap: false }
],
plugins: [uglify(), ts()]
}
];
export default config;