code: function expandScriptRequirePath(content, file) {
      var requireRegStr = '(\\brequire(?:\\s*\\.\\s*(?:async|defer))?\\s*\\(\\s*)(' +
        stringRegStr + '|' +
        jsStringArrayRegStr + ')';
  
      //first match the string or comment
      var reg = new RegExp(stringRegStr + '|' +
      jscommentRegStr + '|' +
      requireRegStr, 'g');
  
      content = tagFilter.filterBlock(content,
        'script', smarty_left_delimiter, smarty_right_delimiter,
        function (outter, attr, inner) {
  
          inner = inner.replace(reg,
            function (all, requirePrefix, requireValueStr) {
              var hasBrackets = false;
  
              if (requirePrefix) {
  
                //if here has '[]' , cut it
                requireValueStr = requireValueStr.trim().replace(/(^\[|\]$)/g, function (m, v) {
                  if (v) {
                    hasBrackets = true;
                  }
                  return '';
                });
                var info;
                var path;
                var ret;
                if (hasBrackets) { //Array
                  var requireValue = requireValueStr.split(/\s*,\s*/);
                  all = requirePrefix +
                  '[' + requireValue.map(function (value) {
                    info = her.util.stringQuote(value);
                    path = info.rest;
                    ret = info.quote + her.uri.getId(path, file.dirname).id + info.quote;
                    return ret;
                  }).join(',') + ']';
                } else { //String
                  info = her.util.stringQuote(requireValueStr);
                  path = info.rest;
  
                  ret = info.quote + her.uri.getId(path, file.dirname).id + info.quote;
                  all = requirePrefix + ret;
                }
  
              }
              return all;
            });
  
          return smarty_left_delimiter +
            'script' +
            attr +
            smarty_right_delimiter +
            inner +
            smarty_left_delimiter +
            '/script' +
            smarty_right_delimiter;
        });
      return content;
    }
docs: expand require、require.async、require.defer path in js