npm install --dev @relative-ci/agent
or
yarn add --dev @relative-ci/agent
npm install --dev rollup-plugin-webpack-stats
or
yarn add --dev rollup-plugin-webpack-stats
Output Vite stats JSON with a webpack stats structure supported by @relative-ci/agent
// vite.config.js
import { defineConfig } from 'vite';
import { webpackStats } from 'rollup-plugin-webpack-stats';
export default defineConfig((env) => ({
plugins: [
// Output webpack-stats.json file
webpackStats(),
],
}));
// relativeci.config.js
module.exports = {
webpack: {
// Path to Webpack stats JSON file
stats: './dist/webpack-stats.json'
}
};
(Required) Navigate to https://app.relative-ci.com, go to the project Settings -> API Keys page and copy the project API key.
(Required for unsupported CI services) Set your GitHub project slug (eg: webpack/webpack.js.org
) if your CI service is not supported (https://github.com/semantic-release/env-ci#supported-ci).
(Required for Enterprise Cloud customers)
# .github/workflow/build.yml
name: Build
on: push
jobs:
build:
steps:
- name: Build application & bundle stats
run: npm run build
- name: Send bundle stats and build information to RelativeCI
run: npx relative-ci-agent
env:
RELATIVE_CI_KEY: ${{ secrets.RELATIVE_CI_KEY }}
# .circleci/config.yml
version: 2
jobs:
build:
steps:
# ...
- run:
name: Build application & webpack stats
command: npm run build
- run:
name: Send bundle stats and build information to Relative CI
command: npx relative-ci-agent