Build: replace CRLF with LF during minify
[jquery.git] / build / tasks / lib / rollup-plugin-file-overrides.js
blobc494e4e5d76e980958c3391f4f1c034185c142d6
1 "use strict";
3 /**
4  * A Rollup plugin accepting a file overrides map and changing
5  * module sources to the overridden ones where provided. Files
6  * without overrides are loaded from disk.
7  *
8  * @param {Map<string, string>} fileOverrides
9  */
10 module.exports = ( fileOverrides ) => {
11         return {
12                 name: "jquery-file-overrides",
13                 load( id ) {
14                         if ( fileOverrides.has( id ) ) {
16                                 // Replace the module by a fake source.
17                                 return fileOverrides.get( id );
18                         }
20                         // Handle this module via the file system.
21                         return null;
22                 }
23         };