-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsdx.config.js
More file actions
42 lines (41 loc) · 1.04 KB
/
Copy pathtsdx.config.js
File metadata and controls
42 lines (41 loc) · 1.04 KB
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
36
37
38
39
40
41
42
const postcss = require('rollup-plugin-postcss')
const peerDepsExternal = require('rollup-plugin-peer-deps-external')
const commonjs = require('@rollup/plugin-commonjs')
const { nodeResolve } = require('@rollup/plugin-node-resolve')
const pkg = require('./package.json')
module.exports = {
rollup(config) {
if (config.output.format === 'umd') {
delete config.external
}
config.external = [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
'./src'
]
config.plugins.push(
peerDepsExternal(),
nodeResolve({
ignoreGlobal: false,
include: ['node_modules/**'],
extensions: ['.js', '.jsx', '.ts', '.tsx']
}),
postcss({
config: {
path: './postcss.config.js'
},
extensions: ['.css'],
minimize: true,
inject: {
insertAt: 'top'
}
}),
commonjs({
namedExports: {
'react-js': ['isValidElementType']
}
})
)
return config
}
}