-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
rollup.config.js
46 lines (40 loc) · 1.31 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 banner2 from 'rollup-plugin-banner2'
import commonjs from '@rollup/plugin-commonjs'
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import json from '@rollup/plugin-json'
import terser from '@rollup/plugin-terser'
import pkg from './package.json' assert { type: 'json' }
const bannerText = `/*! *****************************************************************************
${pkg.name}
Version ${pkg.version}
${pkg.description}
Please submit bugs at ${pkg.bugs.url}
(c) ${pkg.author ? pkg.author : pkg.contributors}
Licence: ${pkg.license}
This file is auto-generated. Do not edit.
***************************************************************************** */
`
export default [
{
input: './src/frontend/Frontend.ts',
external: ['logger'],
plugins: [typescript({ module: 'ESNext' }), nodeResolve(), commonjs(), terser(), banner2(() => bannerText)],
output: {
file: './' + pkg.main,
format: 'iife',
globals: {
logger: 'Log'
}
}
},
{
input: './src/backend/Backend.ts',
external: ['node_helper', 'logger'],
plugins: [json(), typescript({ module: 'ESNext' }), nodeResolve(), terser(), banner2(() => bannerText)],
output: {
file: './node_helper.js',
format: 'cjs'
}
}
]