-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathrollup.base.config.mjs
More file actions
33 lines (32 loc) · 1.16 KB
/
rollup.base.config.mjs
File metadata and controls
33 lines (32 loc) · 1.16 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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import postcss from 'rollup-plugin-postcss';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import { babel } from '@rollup/plugin-babel';
import preserveDirectives from 'rollup-preserve-directives';
export default {
plugins: [
peerDepsExternal(), // Exclude peer dependencies from the bundle
resolve({
// Locates and bundles dependencies in node_modules
browser: true,
preferBuiltins: false,
}),
commonjs(), // Converts CommonJS modules to ES6
babel({
// Transpiles the code using Babel
babelHelpers: 'bundled',
exclude: /node_modules/,
presets: ['@babel/preset-react', '@babel/preset-typescript'],
}),
typescript({
// Compiles TypeScript files
tsconfig: './tsconfig.json',
sourceMap: true,
}),
postcss(), // Process CSS files
preserveDirectives(), // Preserve directives in the output (i.e., "use client")
],
external: ['react', 'react-dom', 'generaltranslation', '@generaltranslation/supported-locales'],
};