-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathgetAdditionalEntries.js
More file actions
26 lines (22 loc) · 874 Bytes
/
getAdditionalEntries.js
File metadata and controls
26 lines (22 loc) · 874 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
/**
* @typedef {Object} AdditionalEntries
* @property {string[]} prependEntries
* @property {string[]} overlayEntries
*/
/**
* Creates an object that contains two entry arrays: the prependEntries and overlayEntries
* @param {import('../types').NormalizedPluginOptions} options Configuration options for this plugin.
* @returns {AdditionalEntries} An object that contains the Webpack entries for prepending and the overlay feature
*/
function getAdditionalEntries(options) {
const prependEntries = [
// React-refresh runtime
require.resolve('../../client/ReactRefreshEntry'),
];
const overlayEntries = [
// Error overlay runtime
options.overlay && options.overlay.entry && require.resolve(options.overlay.entry),
].filter((x) => typeof x === 'string');
return { prependEntries, overlayEntries };
}
module.exports = getAdditionalEntries;