UNPKG

laravel-mix-glob

Version:

Laravel mix extension that add support for globs usage with an extensive concise api. For a more natural boosted productivity and dynamic. Configure once and forget about adding the files each time.

3 lines (2 loc) 983 B
"use strict";var e=require("path"),t=require("../../Helpers/index.js"),i=require("./extensionMapping.js");exports.mapSrcFile=function(n,r,o){let s,a,p,f;if(s="function"==typeof o.outMap?o.outMap(n,r):o.outMap,a="function"==typeof o.baseMap?o.baseMap(n,r):o.baseMap,p="function"==typeof o.specifier?o.specifier(n,r):o.specifier,f="function"==typeof o.extensionMap?o.extensionMap(n,r):o.extensionMap||i.resolveExtension(n,r),a){let i=e.relative(a,n);if(".."===i.substring(0,2))throw new Error(`base is not a base for the file src!\n base: ${a}\n srcFile: ${n}\nMake sure the base is valid for the file.\nYou can use map function for base to map it according to the file types that you expect! Otherwise see what's wrong\n`);return p&&(i=t.removeSpecifier(i,p)),f&&(i=t.replaceExtension(i,f)),e.join(s,i)}if(!a&&"string"==typeof o.outMap){let i=e.basename(n);return p&&(i=t.removeSpecifier(i,p)),f&&(i=t.replaceExtension(i,f)),e.join(s,i)}return s}; //# sourceMappingURL=index.js.map