forked from linpengteng/cz-message-helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.cjs
43 lines (41 loc) · 1011 Bytes
/
rollup.config.cjs
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
43
const { defineConfig } = require('rollup')
const nodeResolve = require('@rollup/plugin-node-resolve')
const typescript = require('@rollup/plugin-typescript')
const commonjs = require('@rollup/plugin-commonjs')
/**
* Rollup Configuration
*/
module.exports = defineConfig([
{
input: 'src/index.ts',
output: [
{
dir: './',
format: 'cjs',
exports: 'auto',
sourcemap: false,
entryFileNames: '[name].cjs',
chunkFileNames: '[name]-[hash].cjs',
paths: id => /.+(\/config\.(cn|en)\.(js|ts))/.test(id) ? id.replace(/.+(\/config\.(cn|en)\.(js|ts))/, './src/$1') : undefined
}
],
plugins: [
typescript({ sourceMap: false }),
nodeResolve(),
commonjs()
],
external: [
'node:child_process',
'node:constants',
'node:path',
'node:fs',
'node:os',
'../config.cn.js',
'../config.en.js',
'find-config',
'word-wrap',
'inquirer',
'rimraf'
]
}
])