-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Relative-CI to detect size changes in the Next.js integration tes…
…t build. (#225) * add `webpack-stats-plugin` * add github workflow
- Loading branch information
Showing
8 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: RelativeCI | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Run tests"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send bundle stats and build information to RelativeCI | ||
uses: relative-ci/agent-action@v2 | ||
with: | ||
key: ${{ secrets.RELATIVE_CI_KEY }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ yalc.lock | |
.vercel | ||
.next/ | ||
test-results/ | ||
webpack-stats.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
const { StatsWriterPlugin } = require("webpack-stats-plugin"); | ||
|
||
module.exports = nextConfig; | ||
module.exports = { | ||
webpack: (config, options) => { | ||
const { dev, isServer } = options; | ||
|
||
// Output webpack stats JSON file only for | ||
// client-side/production build | ||
if (!dev && !isServer) { | ||
config.plugins.push( | ||
new StatsWriterPlugin({ | ||
filename: "../webpack-stats.json", | ||
stats: { | ||
assets: true, | ||
chunks: true, | ||
modules: true, | ||
excludeAssets: [/webpack-stats.json/], | ||
}, | ||
}) | ||
); | ||
} | ||
|
||
return config; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters