You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
634 B
26 lines
634 B
2 years ago
|
const { d, n } = require('../../options');
|
||
|
|
||
|
/**
|
||
|
* Normalizes the options for the loader.
|
||
|
* @param {import('../types').ReactRefreshLoaderOptions} options Non-normalized loader options.
|
||
|
* @returns {import('../types').NormalizedLoaderOptions} Normalized loader options.
|
||
|
*/
|
||
|
const normalizeOptions = (options) => {
|
||
|
d(options, 'const', false);
|
||
|
|
||
|
n(options, 'esModule', (esModule) => {
|
||
|
if (typeof esModule === 'boolean' || typeof esModule === 'undefined') {
|
||
|
return esModule;
|
||
|
}
|
||
|
|
||
|
d(esModule, 'include');
|
||
|
d(esModule, 'exclude');
|
||
|
|
||
|
return esModule;
|
||
|
});
|
||
|
|
||
|
return options;
|
||
|
};
|
||
|
|
||
|
module.exports = normalizeOptions;
|