Skip to content

Commit fe0cd90

Browse files
authored
bundle stats (#347)
* bundle stats * fix
1 parent bc826cf commit fe0cd90

File tree

5 files changed

+53
-8
lines changed

5 files changed

+53
-8
lines changed

.github/workflows/build.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ jobs:
144144
path: packages/editor/playwright-report/
145145
retention-days: 30
146146

147+
# Upload webpack-stats.json to use on relative-ci.yaml workflow
148+
- name: Upload webpack stats artifact
149+
uses: relative-ci/agent-upload-artifact-action@v1
150+
with:
151+
webpackStatsFile: ./packages/editor/dist/webpack-stats.json
147152
# - name: Upload to coveralls
148153
# uses: coverallsapp/github-action@master
149154
# with:

.github/workflows/relative-ci.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: RelativeCI
2+
3+
on:
4+
workflow_run:
5+
workflows: ["build"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Send bundle stats and build information to RelativeCI
14+
uses: relative-ci/agent-action@v2
15+
with:
16+
key: ${{ secrets.RELATIVE_CI_KEY }}
17+
token: ${{ secrets.GITHUB_TOKEN }}

package-lock.json

Lines changed: 27 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/editor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
"rollup-plugin-node-polyfills": "^0.2.1",
174174
"rollup-plugin-polyfill-node": "^0.12.0",
175175
"vite": "^4.4.2",
176-
"vitest": "^0.33.0"
176+
"vitest": "^0.33.0",
177+
"rollup-plugin-webpack-stats": "^0.2.0"
177178
}
178179
}

packages/editor/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import react from "@vitejs/plugin-react";
22
import history from "connect-history-api-fallback";
33
import nodePolyfills from "rollup-plugin-polyfill-node";
4+
import { webpackStats } from "rollup-plugin-webpack-stats";
45
import { ViteDevServer } from "vite";
56
import { defineConfig } from "vitest/config";
67

@@ -34,7 +35,7 @@ export default defineConfig({
3435
// global: "globalThis", // breaks some modules work because of https://github.com/vitejs/vite/issues/6295, done in index.tsx instead
3536
// process & buffer are added to global scope in index.host.tsx
3637
},
37-
plugins: [react(), redirectAll()],
38+
plugins: [react(), redirectAll(), webpackStats()],
3839
resolve: {
3940
alias: {
4041
buffer: "rollup-plugin-node-polyfills/polyfills/buffer-es6",

0 commit comments

Comments
 (0)