-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.server.bundler.js
27 lines (25 loc) · 1.01 KB
/
rollup.server.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
const json = require('@rollup/plugin-json')
const typescript = require('@rollup/plugin-typescript')
const { builtinModules } = require('module')
const pkg = require('../package.json')
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')
module.exports = {
...ioConfig.getServerConfig(),
plugins: [
json(),
environmentConfig.replaceEnvironment(),
cssBundler.getServerConfig(),
svelteConfig.getServerConfig(),
resolveConfig.getServerConfig(),
commonJsConfig.useCommonJs(),
typescript({ sourceMap: environmentConfig.dev, inlineSources: environmentConfig.dev }),
],
external: Object.keys(pkg.dependencies).concat(builtinModules || Object.keys(process.binding('natives'))),
onwarn: warnBundler.onwarn,
}