forked from postlight/lux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
38 lines (36 loc) · 925 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
32
33
34
35
36
37
38
import path from 'path'
import json from 'rollup-plugin-json'
import babel from 'rollup-plugin-babel'
import resolve from 'rollup-plugin-node-resolve'
export default {
dest: 'dist/index.js',
entry: 'src/packages/cli/commands/index.js',
format: 'cjs',
banner: (
'require(\'source-map-support\').install({\n'
+ ' environment: \'node\'\n'
+ '});\n'
),
onwarn: ({ code, message }) => {
if (code === 'UNUSED_EXTERNAL_IMPORT') {
return
}
// eslint-disable-next-line no-console
console.warn(message)
},
plugins: [
json(),
babel(),
resolve()
],
external: id => !(
id.startsWith('.')
|| id.startsWith('/') // Absolute path on Unix
|| /^[A-Z]:[\\/]/.test(id) // Absolute path on Windows
|| id.startsWith('src')
|| id.startsWith(path.join(__dirname, 'src'))
|| id === 'babelHelpers'
|| id === '\u0000babelHelpers'
),
sourceMap: true
}