(languages)
| 181 | } |
| 182 | |
| 183 | const builtInLanguagesPlugin = (languages) => ({ |
| 184 | name: "hljs-index", |
| 185 | resolveId(source) { |
| 186 | if (source === "builtInLanguages") { |
| 187 | return source; // this signals that rollup should not ask other plugins or check the file system to find this id |
| 188 | } |
| 189 | return null; // other ids should be handled as usually |
| 190 | }, |
| 191 | load(id) { |
| 192 | const escape = (s) => "grmr_" + s.replace("-", "_"); |
| 193 | if (id === "builtInLanguages") { |
| 194 | return languages.map((lang) => |
| 195 | `export { default as ${escape(lang.name)} } from ${JSON.stringify(lang.path)};` |
| 196 | ).join("\n"); |
| 197 | } |
| 198 | return null; |
| 199 | } |
| 200 | }); |
| 201 | |
| 202 | async function buildCore(name, languages, options) { |
| 203 | const header = buildHeader(); |
no outgoing calls
no test coverage detected
searching dependent graphs…