Skip to content

Commit 37b7bf2

Browse files
committed
fix(nf): throw in bundle shared if there is an error
1 parent a63cfab commit 37b7bf2

File tree

8 files changed

+18
-13
lines changed

8 files changed

+18
-13
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@softarc/native-federation",
3-
"version": "2.0.19",
3+
"version": "2.0.20",
44
"type": "commonjs",
55
"license": "MIT",
66
"dependencies": {
77
"json5": "^2.2.0",
88
"npmlog": "^6.0.2",
9-
"@softarc/native-federation-runtime": "2.0.19"
9+
"@softarc/native-federation-runtime": "2.0.20"
1010
}
1111
}

libs/native-federation-core/src/lib/core/build-for-federation.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export async function buildForFederation(
2828
externals: string[],
2929
buildParams = defaultBuildParams
3030
) {
31-
3231
let artefactInfo: ArtefactInfo | undefined;
3332

3433
if (!buildParams.skipMappingsAndExposed) {
@@ -69,7 +68,7 @@ export async function buildForFederation(
6968
fedOptions,
7069
'browser'
7170
);
72-
71+
7372
const separatePackageInfoServer = await bundleSeparate(
7473
separateServer,
7574
externals,

libs/native-federation-core/src/lib/core/bundle-shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export async function bundleShared(
132132
logger.notice('');
133133

134134
logger.verbose(e);
135+
throw e;
135136
}
136137

137138
const outFileNames = [...exptedResults];

libs/native-federation-esbuild/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@softarc/native-federation-esbuild",
3-
"version": "2.0.19",
3+
"version": "2.0.20",
44
"type": "commonjs",
55
"dependencies": {
66
"@rollup/plugin-commonjs": "^22.0.2",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "@softarc/native-federation-node",
3-
"version": "2.0.19"
3+
"version": "2.0.20"
44
}

libs/native-federation-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@softarc/native-federation-runtime",
3-
"version": "2.0.19",
3+
"version": "2.0.20",
44
"dependencies": {
55
"tslib": "^2.3.0"
66
},

libs/native-federation/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-architects/native-federation",
3-
"version": "19.0.6",
3+
"version": "19.0.8",
44
"main": "src/index.js",
55
"generators": "./collection.json",
66
"builders": "./builders.json",
@@ -20,8 +20,8 @@
2020
},
2121
"dependencies": {
2222
"@babel/core": "^7.19.0",
23-
"@softarc/native-federation": "2.0.19",
24-
"@softarc/native-federation-runtime": "2.0.19",
23+
"@softarc/native-federation": "2.0.20",
24+
"@softarc/native-federation-runtime": "2.0.20",
2525
"@types/browser-sync": "^2.29.0",
2626
"@chialab/esbuild-plugin-commonjs": "^0.18.0",
2727
"browser-sync": "^3.0.2",

libs/native-federation/src/schematics/init/schematic.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,14 @@ function makeServerAsync(
491491
`const port = process.env['PORT'] || ${options.port || 4000}`
492492
)
493493
.replace(
494-
` server.set('view engine', 'html');`,
495-
` server.use(cors())\n server.set('view engine', 'html');`
496-
);
494+
`const app = express();`,
495+
`const app = express();\n app.set('view engine', 'html');`
496+
)
497+
.replace(
498+
`if (isMainModule(import.meta.url)) {`,
499+
``
500+
)
501+
.replace(/\}(?![\s\S]*\})/, '')
497502

498503
tree.create(bootstrapName, updatedContent);
499504

0 commit comments

Comments
 (0)