mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
9fd2fa5388
This commit gets rid of rollup-plugin-hypothetical in favor of a simpler inline Rollup plugin that fits our need and is compatible with Windows. Fixes gh-4548 Closes gh-4549
25 lines
535 B
JavaScript
25 lines
535 B
JavaScript
"use strict";
|
|
|
|
/**
|
|
* A Rollup plugin accepting a file overrides map and changing
|
|
* module sources to the overridden ones where provided. Files
|
|
* without overrides are loaded from disk.
|
|
*
|
|
* @param {Map<string, string>} fileOverrides
|
|
*/
|
|
module.exports = ( fileOverrides ) => {
|
|
return {
|
|
name: "jquery-file-overrides",
|
|
load( id ) {
|
|
if ( fileOverrides.has( id ) ) {
|
|
|
|
// Replace the module by a fake source.
|
|
return fileOverrides.get( id );
|
|
}
|
|
|
|
// Handle this module via the file system.
|
|
return null;
|
|
}
|
|
};
|
|
};
|