-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
41 lines (38 loc) · 915 Bytes
/
rollup.config.ts
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
import type { RollupOptions } from 'rollup';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import autoprefixer from 'autoprefixer';
import postcss from 'rollup-plugin-postcss';
export const outputDir = 'dist';
export const pkgName = 'pull2';
export const outputFilePrefix = `${outputDir}/${pkgName}`;
export const commonConfig = {
input: 'src/index.ts',
plugins: [
resolve(),
commonjs(),
typescript({
tsconfig: './tsconfig.build.json'
}),
postcss({
inject: true,
plugins: [autoprefixer]
})
]
};
const config: RollupOptions = {
...commonConfig,
output: [
{
format: 'cjs',
file: `${outputFilePrefix}.cjs.js`
},
{
format: 'es',
file: `${outputFilePrefix}.esm.js`
}
],
external: ['tslib']
};
export default config;