-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
43 lines (39 loc) · 943 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
39
40
41
42
43
import sass from 'rollup-plugin-sass';
import typescript from 'rollup-plugin-typescript2';
import includePaths from 'rollup-plugin-includepaths';
import { terser } from 'rollup-plugin-terser';
import autoprefixer from 'autoprefixer';
import postcss from 'postcss';
import pkg from './package.json';
const sassOptions = {
insert: true,
processor: (css) =>
postcss([autoprefixer])
.process(css, { from: undefined })
.then((result) => result.css),
};
const includePathOptions = {
include: {},
paths: ['src'],
external: [],
extensions: ['.ts', '.tsx', '.js', '.json', '.scss'],
};
export default {
input: 'src/index.tsx',
output: [
{
file: pkg.main,
format: 'cjs',
exports: 'named',
sourcemap: true,
strict: false,
},
],
plugins: [
sass(sassOptions),
typescript(),
includePaths(includePathOptions),
terser(),
],
external: ['react', 'react-dom'],
};