/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/universal/webpack.config.js
23 строки
643 B
Sebastian Beltran
feat(universal): add example for universal target with ESM support (#21244)
23 июн 2026, 10:12
Не верифицирован
23 июн 2026, 10:12
2e43eb4
Код
Авторство
О чём код?
"use strict"; const path = require("path"); /** @type {import("../../").Configuration} */ const config = { // The universal target: one compiler emits a single bundle that runs in the // browser, web workers, Node.js, Electron and NW.js. Output is always ESM, so // `experiments.outputModule` and `output.module` default to `true` here. target: "universal", entry: "./example.js", output: { path: path.join(__dirname, "dist"), filename: "output.mjs", chunkFilename: "[name].mjs" }, optimization: { // Keep the async chunk filename stable across the example's three builds. chunkIds: "named" } }; module.exports = config;