/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v5.106.2
lib/util/magicComment.js
26 строк
672 B
Aviv Keller
refactor: add basic descriptions (#20787)
10 апр 2026, 18:52
Не верифицирован
10 апр 2026, 18:52
16857f0
Код
Авторство
О чём код?
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Alexander Akait @alexander-akait */ "use strict"; const memoize = require("./memoize"); const getVm = memoize(() => require("vm")); // regexp to match at least one "magic comment" module.exports.createMagicCommentContext = () => getVm().createContext(undefined, { name: "Webpack Magic Comment Parser", codeGeneration: { strings: false, wasm: false } }); module.exports.webpackCommentRegExp = new RegExp( /(^|\W)webpack[A-Z][A-Za-z]+:/ ); // regexp to match at least one "magic comment" /** * Returns magic comment context. * @returns {import("vm").Context} magic comment context */