-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
34 lines (32 loc) · 1.14 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
import replace from '@rollup/plugin-replace'
import nodeResolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import babel from '@rollup/plugin-babel'
import { readFileSync } from 'fs'
const npmPackage = JSON.parse(readFileSync('./package.json'))
export default {
// if you use createSpaConfig, you can use your index.html as entrypoint,
// any <script type="module"> inside will be bundled by rollup
input: './src/widget-value.ts',
output: {
dir: './dist',
sourcemap: true,
name: 'widget_value_bundle',
banner: `/* @license Copyright (c) 2023 Record Evolution GmbH. All rights reserved.*/`,
format: 'esm'
},
plugins: [
replace({
versionplaceholder: npmPackage.version,
preventAssignment: true
}),
typescript({ sourceMap: true }),
nodeResolve(),
commonjs({}),
babel({ babelHelpers: 'bundled' })
]
// alternatively, you can use your JS as entrypoint for rollup and
// optionally set a HTML template manually
// input: './app.js',
}