forked from downshift-js/downshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
31 lines (28 loc) · 912 Bytes
/
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
const commonjs = require('@rollup/plugin-commonjs')
const {babel} = require('@rollup/plugin-babel')
const typescript = require('@rollup/plugin-typescript')
const config = require('kcd-scripts/dist/config/rollup.config')
const babelPluginIndex = config.plugins.findIndex(
plugin => plugin.name === 'babel',
)
const typescriptPluginIndex = config.plugins.findIndex(
plugin => plugin.name === 'typescript',
)
const cjsPluginIndex = config.plugins.findIndex(
plugin => plugin.name === 'commonjs',
)
config.plugins[babelPluginIndex] = babel({
babelHelpers: 'runtime',
exclude: '**/node_modules/**',
})
config.plugins[cjsPluginIndex] = commonjs({
include: 'node_modules/**',
})
if (typescriptPluginIndex === -1) {
config.plugins.push(typescript({tsconfig: 'tsconfig.json'}))
} else {
config.plugins[typescriptPluginIndex] = typescript({
tsconfig: 'tsconfig.json',
})
}
module.exports = config