@rspack/cli
Advanced tools
@@ -94,4 +94,6 @@ "use strict"; | ||
const compiler = await cli.createCompiler(options); | ||
compiler.run(callback); | ||
console.timeEnd("build"); | ||
compiler.run((err, Stats) => { | ||
callback(err, Stats); | ||
console.timeEnd("build"); | ||
}); | ||
}); | ||
@@ -98,0 +100,0 @@ } |
@@ -8,3 +8,3 @@ import yargs from "yargs"; | ||
constructor(); | ||
createCompiler(options: RspackCLIOptions): Promise<import("@rspack/core/dist/compiler").Compiler>; | ||
createCompiler(options: RspackCLIOptions): Promise<import("@rspack/core/src/compiler").Compiler>; | ||
createColors(useColor?: boolean): RspackCLIColors; | ||
@@ -11,0 +11,0 @@ getLogger(): RspackCLILogger; |
@@ -116,7 +116,17 @@ "use strict"; | ||
} | ||
console.log("mode:", options.mode, item.mode); | ||
if (typeof item.stats === "undefined") { | ||
item.stats = { preset: "normal" }; | ||
} | ||
else if (typeof item.stats === "boolean") { | ||
item.stats = item.stats ? { preset: "normal" } : { preset: "none" }; | ||
} | ||
else if (typeof item.stats === "string") { | ||
item.stats = { preset: item.stats }; | ||
} | ||
if (this.colors.isColorSupported && !item.stats.colors) { | ||
item.stats.colors = true; | ||
} | ||
return item; | ||
} | ||
async loadConfig(options) { | ||
var _a; | ||
let loadedConfig; | ||
@@ -154,6 +164,2 @@ // if we pass config paras | ||
} | ||
(_a = loadedConfig.stats) !== null && _a !== void 0 ? _a : (loadedConfig.stats = {}); | ||
if (this.colors.isColorSupported) { | ||
loadedConfig.stats.colors = true; | ||
} | ||
return loadedConfig; | ||
@@ -160,0 +166,0 @@ } |
import { Colorette } from "colorette"; | ||
import { RspackCLI } from "./rspack-cli"; | ||
import { WebpackOptionsNormalized } from "webpack"; | ||
export type { Configuration } from "@rspack/core"; | ||
import { Configuration as DevServerConfig } from "webpack-dev-server"; | ||
@@ -5,0 +6,0 @@ export interface IRspackCLI { |
{ | ||
"name": "@rspack/cli", | ||
"version": "0.0.0-20221108135816", | ||
"version": "0.0.0-20221124101348", | ||
"bin": { | ||
@@ -22,4 +22,4 @@ "rspack": "./bin/rspack" | ||
"@discoveryjs/json-ext": "^0.5.7", | ||
"@rspack/core": "0.0.0-20221108135816", | ||
"@rspack/dev-server": "0.0.0-20221108135816", | ||
"@rspack/core": "0.0.0-20221124101348", | ||
"@rspack/dev-server": "0.0.0-20221124101348", | ||
"colorette": "2.0.19", | ||
@@ -26,0 +26,0 @@ "webpack": "5.74.0", |
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
29427
2.55%429
2.14%