Skip to content

Commit 5856d72

Browse files
authored
remove dev dependency on @rspack/cli (#7096)
1 parent df41c8d commit 5856d72

File tree

4 files changed

+31
-1548
lines changed

4 files changed

+31
-1548
lines changed

.github/workflows/platform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
steps:
6666
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
6767
- uses: ./.github/actions/node/active-lts
68-
# Running `yarn` also automatically runs `rspack` as a postinstall script.
68+
# Running `yarn` also automatically runs Rspack as a postinstall script.
6969
- run: yarn --frozen-lockfile
7070
working-directory: vendor
7171
- run: git diff --exit-code

vendor/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"license": "(Apache-2.0 OR BSD-3-Clause)",
33
"scripts": {
4-
"postinstall": "rspack"
4+
"postinstall": "node rspack"
55
},
66
"dependencies": {
77
"@datadog/sketches-js": "2.1.1",
@@ -32,7 +32,6 @@
3232
"ttl-set": "^1.0.0"
3333
},
3434
"devDependencies": {
35-
"@rspack/cli": "^1.6.4",
3635
"@rspack/core": "^1.6.4",
3736
"license-webpack-plugin": "^4.0.2"
3837
}

vendor/rspack.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict'
2+
3+
const { rspack } = require('@rspack/core')
4+
const config = require('./rspack.config')
5+
6+
rspack(config, (err, stats) => {
7+
if (err) {
8+
console.error(err.stack || err)
9+
if (err.details) {
10+
console.error(err.details)
11+
}
12+
process.exit(1)
13+
}
14+
15+
const info = stats.toJson()
16+
17+
if (stats.hasWarnings()) {
18+
console.warn(info.warnings)
19+
}
20+
21+
if (stats.hasErrors()) {
22+
console.error(info.errors)
23+
process.exit(1)
24+
}
25+
})

0 commit comments

Comments
 (0)