-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.client.bundler.js
34 lines (31 loc) · 1.15 KB
/
rollup.client.bundler.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
const json = require('@rollup/plugin-json')
const typescript = require('@rollup/plugin-typescript')
const { terser } = require('rollup-plugin-terser')
const cssBundler = require('./css.bundler')
const svelteConfig = require('./svelte.bundler')
const environmentConfig = require('./environment.bundler')
const commonJsConfig = require('./common.bundler')
const ioConfig = require('./io.bundler')
const warnBundler = require('./warning.bundler')
const resolveConfig = require('./resolve.bundler')
const testConfig = require('./test.bundler')
module.exports = {
...ioConfig.getClientConfig(),
plugins: [
environmentConfig.replaceEnvironment(),
cssBundler.getClientConfig(),
svelteConfig.getClientConfig(),
resolveConfig.getClientConfig(),
commonJsConfig.useCommonJs(),
typescript({ sourceMap: environmentConfig.dev, inlineSources: environmentConfig.dev }),
json(),
environmentConfig.legacy
&& !environmentConfig.dev
&& terser({
module: true,
}),
environmentConfig.dev && environmentConfig.isCodeCoverage && testConfig.checkCodeCoverage(),
],
preserveEntrySignatures: false,
onwarn: warnBundler.onwarn,
}