mirror of https://github.com/alibaba/ice.git
fix: throw error when server compile failed (#6508)
This commit is contained in:
parent
68f19eaeab
commit
7194c75c0e
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@ice/app': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: throw error when server compile failed
|
|
@ -41,7 +41,10 @@ async function build(options: BuildOptions) {
|
||||||
|
|
||||||
if (isSuccessful) {
|
if (isSuccessful) {
|
||||||
const outputDir = rspackConfigs[0].output.path;
|
const outputDir = rspackConfigs[0].output.path;
|
||||||
const { serverEntry } = await extendsPluginAPI.serverCompileTask.get() || {};
|
const { serverEntry, error } = await extendsPluginAPI.serverCompileTask.get() || {};
|
||||||
|
if (error) {
|
||||||
|
throw new Error('Build failed, please check the error message.');
|
||||||
|
}
|
||||||
const outputPaths = await getOutputPaths({
|
const outputPaths = await getOutputPaths({
|
||||||
rootDir,
|
rootDir,
|
||||||
serverEntry,
|
serverEntry,
|
||||||
|
|
|
@ -52,7 +52,10 @@ async function build(
|
||||||
if (isSuccessful) {
|
if (isSuccessful) {
|
||||||
// Generate html when SSG.
|
// Generate html when SSG.
|
||||||
const outputDir = webpackConfigs[0].output.path;
|
const outputDir = webpackConfigs[0].output.path;
|
||||||
const { serverEntry } = await extendsPluginAPI.serverCompileTask.get() || {};
|
const { serverEntry, error } = await extendsPluginAPI.serverCompileTask.get() || {};
|
||||||
|
if (error) {
|
||||||
|
throw new Error('Build failed, please check the error message.');
|
||||||
|
}
|
||||||
const outputPaths = await getOutputPaths({
|
const outputPaths = await getOutputPaths({
|
||||||
rootDir,
|
rootDir,
|
||||||
serverEntry,
|
serverEntry,
|
||||||
|
|
Loading…
Reference in New Issue