-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
35 lines (33 loc) · 1.03 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
import pkg from './package.json' assert { type: 'json' }
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
import versionInjector from 'rollup-plugin-version-injector'
const external = ['howler', 'tmx-map-parser']
const commonPlugins = [versionInjector(), rollupNodePolyFill(), typescript({ tsconfig: './tsconfig.json' })]
export default [
// browser-friendly UMD build
{
input: 'src/index.ts',
external,
output: {
globals: {
howler: 'howler',
'tmx-map-parser': 'tmx-map-parser'
},
name: 'platfuse',
file: pkg.browser,
format: 'umd'
},
plugins: [...commonPlugins, commonjs()]
},
{
input: 'src/index.ts',
external,
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' }
],
plugins: commonPlugins
}
]