forked from influenceth/cubit
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
29 lines (24 loc) · 766 Bytes
/
Copy pathrollup.config.js
File metadata and controls
29 lines (24 loc) · 766 Bytes
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
import cleanup from 'rollup-plugin-cleanup';
import { getBabelOutputPlugin } from '@rollup/plugin-babel';
import { importAssertionsPlugin } from 'rollup-plugin-import-assert';
import { importAssertions } from 'acorn-import-assertions';
const { env: { NODE_ENV } } = process;
const input = './src/index.js';
const output = [
{ file: './build/index.cjs', format: 'cjs', sourcemap: (NODE_ENV !== 'production') },
{ file: './build/index.js', format: 'es', sourcemap: (NODE_ENV !== 'production') }
];
const plugins = [
cleanup({
comments: 'none',
extensions: ['*']
}),
getBabelOutputPlugin({ presets: ['@babel/preset-env'] }),
importAssertionsPlugin()
];
export default {
acornInjectPlugins: [importAssertions],
input,
output,
plugins
};