Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.

Commit 0295c00

Browse files
committed
feat: new API
1 parent dee7526 commit 0295c00

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/webpack-plugin/src/index.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ class BundleAnalyzer {
4949
async function sendBuild() {
5050
const assets = await sizeAssets(stats)
5151

52-
const { data: build } = await axios.post(`${apiUrl}/builds`, {
52+
const { data: bundle } = await axios.post(`${apiUrl}/bundles`, {
5353
token,
54-
branch: metadata.branch,
55-
commit: metadata.commit,
56-
providerMetadata: metadata,
54+
bundler: 'webpack',
5755
stats: {
5856
assets,
5957
chunksNumber: stats.chunks.length,
@@ -64,16 +62,20 @@ class BundleAnalyzer {
6462

6563
await axios.request({
6664
method: 'put',
67-
url: build.webpackStatsPutUrl,
65+
url: bundle.webpackStatsPutUrl,
6866
data: gzipSync(Buffer.from(JSON.stringify(stats))),
6967
headers: {
7068
'content-encoding': 'gzip',
7169
},
7270
maxContentLength: 30 * 1024 * 1024,
7371
})
7472

75-
await axios.post(`${apiUrl}/builds/${build.id}/start`, {
73+
await axios.post(`${apiUrl}/builds`, {
7674
token,
75+
bundleId: bundle.id,
76+
branch: metadata.branch,
77+
commit: metadata.commit,
78+
providerMetadata: metadata,
7779
})
7880
}
7981

0 commit comments

Comments
 (0)