-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.js
42 lines (41 loc) · 1 KB
/
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
39
40
41
42
import { defineConfig } from 'rollup';
import pkg from './package.json';
import dts from 'rollup-plugin-dts';
import resolve from '@rollup/plugin-node-resolve';
import { swc } from 'rollup-plugin-swc3';
import babel from '@rollup/plugin-babel';
import { DEFAULT_EXTENSIONS } from '@babel/core';
export default defineConfig([
{
input: 'src/index.ts',
plugins: [
resolve(),
babel({
presets: ['@babel/preset-typescript', 'babel-preset-solid'],
extensions: [...DEFAULT_EXTENSIONS, '.ts', '.tsx'],
include: ['src/**'],
}),
swc({
minify: process.env.NODE_ENV === 'production',
}),
],
external: [...Object.keys(pkg.peerDependencies), 'solid-js/web'],
output: [
{
file: 'dist/cjs/index.js',
format: 'cjs',
},
{
file: 'dist/esm/index.js',
format: 'esm',
},
],
},
{
input: 'src/index.ts',
output: {
file: 'dist/index.d.ts',
},
plugins: [resolve(), dts()],
},
]);