-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
31 lines (28 loc) · 863 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
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import filesize from 'rollup-plugin-filesize';
import path from 'path';
const { LERNA_PACKAGE_NAME } = process.env;
const PACKAGE_ROOT_PATH = process.cwd();
const INPUT_FILE = path.join(PACKAGE_ROOT_PATH, 'src/index.js');
const OUTPUT_DIR = path.join(PACKAGE_ROOT_PATH, 'dist');
const allModules = ['@qbaepst/bar', '@qbaepst/baz', '@qbaepst/foo'];
const formats = ['es', 'cjs'];
export default {
plugins: [
babel({
babelrc: false,
exclude: ['node_modules/**'],
presets: ['@babel/preset-env', '@babel/preset-react'],
}),
commonjs(),
filesize(),
],
input: INPUT_FILE,
external: allModules,
output: formats.map(format => ({
file: path.join(OUTPUT_DIR, `index.${format}.js`),
format,
name: LERNA_PACKAGE_NAME,
})),
};