-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
48 lines (46 loc) · 1.08 KB
/
rollup.config.mjs
File metadata and controls
48 lines (46 loc) · 1.08 KB
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
44
45
46
47
48
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import image from '@rollup/plugin-image';
import resolve from '@rollup/plugin-node-resolve';
import { readFileSync } from 'fs';
import external from 'rollup-plugin-peer-deps-external';
import postcss from 'rollup-plugin-postcss';
const pkg = JSON.parse(readFileSync('./package.json'));
export default {
onwarn: (warning, warn) => {
if (warning.code === 'MODULE_LEVEL_DIRECTIVE' && warning.message.includes('"use client"')) return;
warn(warning);
},
input: './src/index.js',
output: [
{
file: pkg.main,
format: 'cjs',
},
{
file: pkg.module,
format: 'esm',
},
],
external: [
'react',
'react-dom',
'prop-types',
'@mui/material',
'@mui/icons-material',
'@mui/styles',
'react-i18next',
'react-router-dom',
],
plugins: [
external(),
postcss(),
babel({
exclude: ['node_modules/**', 'tests/**'],
babelHelpers: 'bundled',
}),
resolve(),
commonjs({ strictRequires: 'auto' }),
image(),
],
};