-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
49 lines (43 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
47
48
49
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 { terser } from 'rollup-plugin-terser'
const pkg = require('./package.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',
plugins: [typescript({ module: 'ESNext' }), nodeResolve(), commonjs(), terser(), banner2(() => bannerText)],
output: {
file: './' + pkg.main,
format: 'iife'
}
},
{
input: './src/backend/Backend.ts',
external: [
'node_helper',
'apollo-cache-inmemory',
'apollo-client',
'apollo-link-context',
'apollo-link-http',
'graphql-tag',
'node-fetch'
],
plugins: [typescript({ module: 'ESNext' }), terser(), banner2(() => bannerText)],
output: {
file: './node_helper.js',
format: 'cjs'
}
}
]