-
Notifications
You must be signed in to change notification settings - Fork 338
/
rollup.config.js
37 lines (35 loc) · 914 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
import path from 'path';
import json from '@rollup/plugin-json';
import { terser } from 'rollup-plugin-terser';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs'; // commonjs模块转换插件
import cleanup from 'rollup-plugin-cleanup';
import ts from 'rollup-plugin-typescript2';
import alias from 'rollup-plugin-alias';
const plugins = [
cleanup(),
json(),
nodeResolve(),
ts({
tsconfig: path.resolve(__dirname, './tsconfig.json'), // 导入本地ts配置
clean: true,
useTsconfigDeclarationDir: true,
}),
commonjs(),
alias({
entries: [{ find: '@', replacement: './lib' }],
}),
terser(),
];
module.exports = {
input: path.resolve('./lib/index.ts'),
output: [
{
exports: 'auto',
file: path.resolve(__dirname, './dist/index.js'),
format: 'umd',
name: 'pinyinPro',
},
],
plugins,
};