(environment: Environment)
| 1282 | const lockfilePaths = lockfileFormats.map((l) => l.path) |
| 1283 | |
| 1284 | function getConfigHash(environment: Environment): string { |
| 1285 | // Take config into account |
| 1286 | // only a subset of config options that can affect dep optimization |
| 1287 | const { config } = environment |
| 1288 | const { optimizeDeps } = config |
| 1289 | const content = JSON.stringify( |
| 1290 | { |
| 1291 | define: !config.keepProcessEnv |
| 1292 | ? process.env.NODE_ENV || config.mode |
| 1293 | : null, |
| 1294 | root: config.root, |
| 1295 | resolve: config.resolve, |
| 1296 | assetsInclude: config.assetsInclude, |
| 1297 | plugins: config.plugins.map((p) => p.name), |
| 1298 | optimizeDeps: { |
| 1299 | include: optimizeDeps.include |
| 1300 | ? unique(optimizeDeps.include).sort() |
| 1301 | : undefined, |
| 1302 | exclude: optimizeDeps.exclude |
| 1303 | ? unique(optimizeDeps.exclude).sort() |
| 1304 | : undefined, |
| 1305 | rolldownOptions: { |
| 1306 | ...optimizeDeps.rolldownOptions, |
| 1307 | plugins: undefined, // included in optimizeDepsPluginNames |
| 1308 | onLog: undefined, |
| 1309 | onwarn: undefined, |
| 1310 | checks: undefined, |
| 1311 | output: { |
| 1312 | ...optimizeDeps.rolldownOptions?.output, |
| 1313 | plugins: undefined, // included in optimizeDepsPluginNames |
| 1314 | }, |
| 1315 | }, |
| 1316 | }, |
| 1317 | optimizeDepsPluginNames: config.optimizeDepsPluginNames, |
| 1318 | }, |
| 1319 | (_, value) => { |
| 1320 | if (typeof value === 'function' || value instanceof RegExp) { |
| 1321 | return value.toString() |
| 1322 | } |
| 1323 | return value |
| 1324 | }, |
| 1325 | ) |
| 1326 | return getHash(content) |
| 1327 | } |
| 1328 | |
| 1329 | function getLockfileHash(environment: Environment): string { |
| 1330 | const lockfilePath = lookupFile(environment.config.root, lockfilePaths) |
no test coverage detected