'use strict'; var webpack = require('webpack'); var withBuildId = function (options) { return function (nextConfig) { return Object.assign({}, nextConfig, { /* eslint-disable-next-line */ webpack: function (config, context) { var _a; var envName = (options === null || options === void 0 ? void 0 : options.name) || 'NEXT_PUBLIC_BUILD_ID'; var defineBuildIdPlugin = new webpack.DefinePlugin((_a = {}, _a["process.env.".concat(envName)] = JSON.stringify(context.buildId), _a)); if (!config.plugins) config.plugins = []; config.plugins.push(defineBuildIdPlugin); if (typeof nextConfig.webpack === 'function') { return nextConfig.webpack(config, context); } return config; } }); }; }; module.exports = withBuildId; //# sourceMappingURL=index.cjs.map