UNPKG

webpack

Version:

Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.

16 lines (13 loc) 416 B
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Sam Chen @chenxsan */ "use strict"; /** * @param {string} urlAndGlobal the script request * @returns {string[]} script url and its global variable */ module.exports = function extractUrlAndGlobal(urlAndGlobal) { const index = urlAndGlobal.indexOf("@"); return [urlAndGlobal.substring(index + 1), urlAndGlobal.substring(0, index)]; };