-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
42 lines (36 loc) · 994 Bytes
/
rollup.config.mjs
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
import path from 'path';
import {fileURLToPath} from 'url';
import copy from 'rollup-plugin-copy';
import {buildConfig} from '../../config/rollup.mjs';
const cwd = fileURLToPath(new URL('.', import.meta.url));
const config = buildConfig(import.meta.url, {
entries: [
'./src/index.ts',
'./src/babel-plugin.ts',
'./src/webpack-parts/index.ts',
'./src/webpack-parts/loader.ts',
'./src/worker.ts',
],
entrypoints: {
index: './src/index.ts',
babel: './src/babel-plugin.ts',
webpack: './src/webpack-parts/index.ts',
'webpack-loader': './src/webpack-parts/loader.ts',
worker: './src/worker.ts',
},
});
config[0].plugins.push(
copy({
targets: [
{
src: path.resolve(cwd, './src/wrappers/*'),
dest: [
path.resolve(cwd, './build/cjs/wrappers'),
path.resolve(cwd, './build/esm/wrappers'),
path.resolve(cwd, './build/esnext/wrappers'),
],
},
],
}),
);
export default config;