Debug @relative-ci/agent webpack plugin

Use DEBUG environment variable

To debug @relative-ci/agent webpack plugin activity, set DEBUG=relative-ci:agent environment variable when you run your build command:

$ DEBUG=relative-ci:agent npm run build

relative-ci:agent {
  includeCommitMessage: true,
  payloadFilepath: undefined,
  stats: {
    context: '/home/repo',
    assets: true,
    entrypoints: true,
    chunks: true,
    modules: true
  },
  enabled: true
}

relative-ci:agent env-ci params {
  branch: 'master',
  commit: '9647c02969298e8b517d29724fce2652856dd36f',
  isCi: true,
  pr: 19,
  prBranch: 'feature-update-login',
  service: 'github',
  slug: 'acme/web-app'
}

relative-ci:agent RELATIVE_CI_SLUG not available, using env-ci

relative-ci:agent Payload {
  key: '***',
  project: 'acme/web-app',
  service: 'github',
  job: {
    commit: '9647c02969298e8b517d29724fce2652856dd36f',
    branch: 'feature-update-login',
    prNumber: 19,
    buildNumber: undefined,
    buildUrl: undefined,
    commitMessage: 'feat: Update login action'
  },
  rawData: { webpack: { stats: [Object] } },
  agentVersion: '2.1.0'
}

relative-ci:agent Payload size 219779

relative-ci:agent Response {
  reportUrl: 'https://app.relative-ci.com/projects/acme-web-app/jobs/20',
  res: { job: { internalBuildNumber: 20 } },
  info: { message: { txt: 'Bundle Size 12.57MB (+0.2%).' } }

Inspect payload

To inspect the entire payload, you can configure the plugin to write the data on disk. The payload output contains the data that the agent is sending to relative-ci.com(build information, extracted webpack stats).

const { RelativeCiAgentWebpackPlugin } = require('@relative-ci/agent');

module.exports = {
  // ... your webpack config
  plugins: [
    // ... other plugins
    new RelativeCiAgentWebpackPlugin({
      payloadFilepath: './artifacts/relative-ci-payload.json'
    })
  ]
};