-
Notifications
You must be signed in to change notification settings - Fork 20.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
51 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"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; | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters