@rspack/core
Advanced tools
Comparing version 0.0.0-4f29fdb1e5-20221108142507 to 0.0.0-760f8b6f15-20221110061725
@@ -222,4 +222,11 @@ "use strict"; | ||
let stats = new stats_1.Stats(rawStats); | ||
if (stats.hasErrors()) { | ||
console.log(stats.toString({ | ||
all: false, | ||
warnings: true, | ||
errors: true, | ||
...this.options.stats | ||
})); | ||
} | ||
// TODO: log stats string should move to cli | ||
console.log(stats.toString(this.options.stats)); | ||
console.log("build success, time cost", Date.now() - begin, "ms"); | ||
@@ -246,3 +253,10 @@ let pendingChangedFilepaths = new Set(); | ||
// TODO: log stats string should move to cli | ||
console.log(stats.toString(this.options.stats)); | ||
if (stats.hasErrors()) { | ||
console.log(stats.toString({ | ||
all: false, | ||
warnings: true, | ||
errors: true, | ||
...this.options.stats | ||
})); | ||
} | ||
isBuildFinished = true; | ||
@@ -249,0 +263,0 @@ const hasPending = Boolean(pendingChangedFilepaths.size); |
@@ -15,2 +15,3 @@ import type { Context, ResolvedContext } from "./context"; | ||
import { ResolvedStatsOptions, StatsOptions } from "./stats"; | ||
export declare type Configuration = RspackOptions; | ||
export interface RspackOptions { | ||
@@ -17,0 +18,0 @@ name?: string; |
@@ -5,4 +5,7 @@ import * as binding from "@rspack/binding"; | ||
colors?: boolean; | ||
all?: boolean; | ||
warnings?: boolean; | ||
errors?: boolean; | ||
} | ||
export declare function resolveStatsOptions(options?: StatsOptions): ResolvedStatsOptions; | ||
//# sourceMappingURL=stats.d.ts.map |
import * as binding from "@rspack/binding"; | ||
import { StatsOptions } from "./config/stats"; | ||
export declare type StatsCompilation = Omit<binding.StatsCompilation, "entrypoints"> & { | ||
entrypoints: Record<string, binding.StatsEntrypoint>; | ||
}; | ||
export declare class Stats { | ||
@@ -7,3 +10,3 @@ #private; | ||
hasErrors(): boolean; | ||
toJson(options?: StatsOptions): binding.StatsCompilation; | ||
toJson(options?: StatsOptions): StatsCompilation; | ||
toString(options?: StatsOptions): string; | ||
@@ -10,0 +13,0 @@ static jsonToString(obj: any, useColors: boolean): string; |
@@ -22,3 +22,9 @@ "use strict"; | ||
_Stats_statsJson.set(this, void 0); | ||
__classPrivateFieldSet(this, _Stats_statsJson, statsJson, "f"); | ||
__classPrivateFieldSet(this, _Stats_statsJson, { | ||
...statsJson, | ||
entrypoints: statsJson.entrypoints.reduce((acc, cur) => { | ||
acc[cur.name] = cur; | ||
return acc; | ||
}, {}) | ||
}, "f"); | ||
} | ||
@@ -262,16 +268,16 @@ hasErrors() { | ||
colors.normal(" "); | ||
colors.green(asset); | ||
colors.green(asset.name); | ||
} | ||
for (const name of Object.keys(cg.childAssets)) { | ||
const assets = cg.childAssets[name]; | ||
if (assets && assets.length > 0) { | ||
colors.normal(" "); | ||
colors.magenta(`(${name}:`); | ||
for (const asset of assets) { | ||
colors.normal(" "); | ||
colors.green(asset); | ||
} | ||
colors.magenta(")"); | ||
} | ||
} | ||
// for (const name of Object.keys(cg.childAssets)) { | ||
// const assets = cg.childAssets[name]; | ||
// if (assets && assets.length > 0) { | ||
// colors.normal(" "); | ||
// colors.magenta(`(${name}:`); | ||
// for (const asset of assets) { | ||
// colors.normal(" "); | ||
// colors.green(asset); | ||
// } | ||
// colors.magenta(")"); | ||
// } | ||
// } | ||
newline(); | ||
@@ -278,0 +284,0 @@ } |
{ | ||
"name": "@rspack/core", | ||
"version": "0.0.0-4f29fdb1e5-20221108142507", | ||
"version": "0.0.0-760f8b6f15-20221110061725", | ||
"main": "./dist/index.js", | ||
@@ -10,3 +10,3 @@ "types": "./dist/index.d.ts", | ||
"devDependencies": { | ||
"@rspack/core": "0.0.0-4f29fdb1e5-20221108142507", | ||
"@rspack/core": "0.0.0-760f8b6f15-20221110061725", | ||
"@swc/helpers": "^0.4.12", | ||
@@ -28,6 +28,6 @@ "@types/jest": "29.0.2", | ||
"dependencies": { | ||
"@rspack/binding": "0.0.0-4f29fdb1e5-20221108142507", | ||
"@rspack/dev-client": "0.0.0-4f29fdb1e5-20221108142507", | ||
"@rspack/plugin-less": "^0.0.0-4f29fdb1e5-20221108142507", | ||
"@rspack/plugin-postcss": "^0.0.0-4f29fdb1e5-20221108142507", | ||
"@rspack/binding": "0.0.0-760f8b6f15-20221110061725", | ||
"@rspack/dev-client": "0.0.0-760f8b6f15-20221110061725", | ||
"@rspack/plugin-less": "^0.0.0-760f8b6f15-20221110061725", | ||
"@rspack/plugin-postcss": "^0.0.0-760f8b6f15-20221110061725", | ||
"browserslist": "^4.21.3", | ||
@@ -34,0 +34,0 @@ "chokidar": "3.5.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
276837
4010
+ Added@rspack/binding@0.0.0-760f8b6f15-20221110061725(transitive)
+ Added@rspack/dev-client@0.0.0-760f8b6f15-20221110061725(transitive)
- Removed@rspack/binding@0.0.0-4f29fdb1e5-20221108142507(transitive)
- Removed@rspack/dev-client@0.0.0-4f29fdb1e5-20221108142507(transitive)
Updated@rspack/plugin-postcss@^0.0.0-760f8b6f15-20221110061725