-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
45 lines (42 loc) · 1.23 KB
/
rollup.config.mjs
File metadata and controls
45 lines (42 loc) · 1.23 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
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import glob from 'fast-glob';
const testFiles = [
'e2e_runner.js',
'e2e/utils/test_process.js',
...glob.sync('e2e/(initialize|setup|tests)/**/*.js'),
];
// Generate chunks to keep the original folder structure.
// Needed as we dynamically load these files.
const chunks = {};
for (const file of testFiles) {
chunks[file.slice(0, -'.js'.length)] = file;
}
export default {
input: chunks,
external: ['undici', 'puppeteer'], // This cannot be bundled as `node:sqlite` is experimental in node.js 22. Remove once this feature is no longer behind a flag
plugins: [
nodeResolve({
preferBuiltins: true,
browser: false,
}),
json(),
commonjs({
// Test runner uses dynamic requires, and those are fine.
// Rollup should not try to process them.
ignoreDynamicRequires: true,
}),
],
output: {
dir: './runner_bundled_out',
exports: 'auto',
},
};