CC 4.0 License

The content of this section is derived from the content of the following links and is subject to the CC BY 4.0 license.

The following contents can be assumed to be the result of modifications and deletions based on the original contents if not specifically stated.

Snapshot

Used to decide how the file system snapshots are created and invalidated.

  • Type:
type Snapshot = {
  module?: {
    hash?: boolean;
    timestamp?: boolean;
  };
  resolve?: {
    hash?: boolean;
    timestamp?: boolean;
  };
};

snapshot.resolve

  • Type: object = {hash?: boolean, timestamp?: boolean}

  • Default: { hash: false, timestamp: true }

Snapshots for resolving of requests. When both hash and timestamp are false, the snapshot will be valid forever.

  • hash: Compare content hashes to determine invalidation (more expensive than timestamp, but changes less often).
  • timestamp: Compare timestamps to determine invalidation.

snapshot.module

  • Type: object = {hash?: boolean, timestamp?: boolean}

  • Default: { hash: false, timestamp: true }

Snapshots for building modules. When both hash and timestamp are false, the snapshot will be valid forever.

  • hash: Compare content hashes to determine invalidation (more expensive than timestamp, but changes less often).
  • timestamp: Compare timestamps to determine invalidation.

Usage

You can set the snapshot directly in rspack.config.js:

rspack.config.js
module.exports = {
  snapshot: {
    resolve: {
      hash: true,
    },
  },
};