fix(config): update .smartconfig.json handling and harden bundler runtime compatibility
This commit is contained in:
@@ -52,6 +52,7 @@ export class TsBundleProcess {
|
||||
output: {
|
||||
path: outputDir,
|
||||
filename: outputFilename,
|
||||
module: true,
|
||||
library: {
|
||||
type: 'module' as const,
|
||||
},
|
||||
@@ -86,9 +87,6 @@ export class TsBundleProcess {
|
||||
},
|
||||
],
|
||||
},
|
||||
experiments: {
|
||||
outputModule: true,
|
||||
},
|
||||
};
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -98,6 +96,10 @@ export class TsBundleProcess {
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
if (!stats) {
|
||||
reject(new Error('Rspack did not return stats'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.error(stats.toString());
|
||||
@@ -140,6 +142,7 @@ export class TsBundleProcess {
|
||||
output: {
|
||||
path: outputDir,
|
||||
filename: outputFilename,
|
||||
module: true,
|
||||
library: {
|
||||
type: 'module' as const,
|
||||
},
|
||||
@@ -184,9 +187,6 @@ export class TsBundleProcess {
|
||||
usedExports: true,
|
||||
sideEffects: true,
|
||||
},
|
||||
experiments: {
|
||||
outputModule: true,
|
||||
},
|
||||
};
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -196,6 +196,10 @@ export class TsBundleProcess {
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
if (!stats) {
|
||||
reject(new Error('Rspack did not return stats'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.error(stats.toString());
|
||||
@@ -221,9 +225,11 @@ export class TsBundleProcess {
|
||||
|
||||
const run = async () => {
|
||||
console.log('running spawned compilation process');
|
||||
const transportOptions: interfaces.IEnvTransportOptions = JSON.parse(
|
||||
process.env.transportOptions,
|
||||
);
|
||||
const transportOptionsJson = process.env.transportOptions;
|
||||
if (!transportOptionsJson) {
|
||||
throw new Error('Missing transportOptions environment variable');
|
||||
}
|
||||
const transportOptions: interfaces.IEnvTransportOptions = JSON.parse(transportOptionsJson);
|
||||
console.log('=======> RSPACK');
|
||||
console.log(transportOptions);
|
||||
process.chdir(transportOptions.cwd);
|
||||
|
||||
Reference in New Issue
Block a user