/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/inner-graph/_helpers/testModuleLoader.js
10 строк
395 B
Ryuya
feat: enable tree-shaking for ESM external modules with named imports (#19641)
25 июл 2025, 18:22
Не верифицирован
25 июл 2025, 18:22
262aab7
Код
Авторство
О чём код?
/** @type {import("../../../../").LoaderDefinition<string>} */ module.exports = function () { const usedExports = JSON.parse(this.query.slice(1)); return [ `import { ${usedExports .map((/** @type {string} */ x) => `${x} as export_${x}`) .join(", ")} } from "./module";`, `export default [${usedExports.map((/** @type {string} */ x) => `export_${x}`).join(", ")}];` ].join("\n"); };