forked from reduxjs/redux-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsdx.config.js
35 lines (31 loc) · 870 Bytes
/
tsdx.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
const { join } = require('path')
const stripCode = require('rollup-plugin-strip-code')
const pkg = require('./package.json')
module.exports = {
rollup(config, options) {
config.output.name = 'RTK'
const { env, format } = options
// eslint-disable-next-line default-case
switch (format) {
case 'umd':
delete config.external
config.output.indent = false
if (env === 'production') {
config.plugins.unshift(
stripCode({
start_comment: 'PROD_START_REMOVE_UMD',
end_comment: 'PROD_STOP_REMOVE_UMD'
})
)
config.output.file = join(__dirname, pkg.unpkg)
} else {
config.output.file = config.output.file.replace(
'umd.development',
'umd'
)
}
break
}
return config
}
}