/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/helpers/CurrentScript.js
17 строк
556 B
Alexander Akait
feat: support webpackPrefetch/webpackPreload magic comments on new URL() and Worker (#21012)
20 июл 2026, 21:24
Не верифицирован
20 июл 2026, 21:24
fa942fe
Код
Авторство
О чём код?
"use strict"; class CurrentScript { /** * @param {string=} path relative path segment appended after `https://test.cases/path/` * @param {string=} type MIME type of the script (e.g. `"text/javascript"`, `"module"`) * @param {string=} nonce CSP nonce reflected on `document.currentScript.nonce` */ constructor(path, type, nonce) { this.src = `https://test.cases/path/${path || ""}index.js`; this.type = type || "text/javascript"; this.tagName = "script"; if (nonce !== undefined) this.nonce = nonce; } } module.exports = CurrentScript;