/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/persistent-caching/webpack.config.js
37 строк
894 B
Alexander Akait
refactor: examples (#20085)
04 ноя 2025, 18:22
Не верифицирован
04 ноя 2025, 18:22
196e19e
Код
Авторство
О чём код?
"use strict"; const path = require("path"); /** @type {(env: "development" | "production") => import("webpack").Configuration} */ const config = (env = "development") => ({ mode: env, infrastructureLogging: { // Optional: print more verbose logging about caching level: "verbose" }, cache: { type: "filesystem", // changing the cacheDirectory is optional, // by default it will be in `node_modules/.cache` cacheDirectory: path.resolve(__dirname, ".cache"), // Add additional dependencies to the build buildDependencies: { // recommended to invalidate cache on config changes // This also makes all dependencies of this file build dependencies config: [__filename] // By default webpack and loaders are build dependencies } }, module: { rules: [ { test: /\.css$/, use: ["style-loader", "css-loader"] } ] } }); module.exports = config;