File tree Expand file tree Collapse file tree 8 files changed +29
-18
lines changed
native-federation-esbuild
native-federation-runtime Expand file tree Collapse file tree 8 files changed +29
-18
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @softarc/native-federation" ,
3
- "version" : " 2.0.9 " ,
3
+ "version" : " 2.0.10 " ,
4
4
"type" : " commonjs" ,
5
5
"license" : " MIT" ,
6
6
"dependencies" : {
7
7
"json5" : " ^2.2.0" ,
8
8
"npmlog" : " ^6.0.2" ,
9
- "@softarc/native-federation-runtime" : " 2.0.9 "
9
+ "@softarc/native-federation-runtime" : " 2.0.10 "
10
10
}
11
11
}
Original file line number Diff line number Diff line change @@ -39,18 +39,11 @@ export async function bundleShared(
39
39
// ? `${encName}-${encVersion}-dev.js`
40
40
// : `${encName}-${encVersion}.js`;
41
41
42
- const hashBase = pi . version + '_' + pi . entryPoint ;
43
- const hash = crypto . createHash ( 'sha256' )
44
- . update ( hashBase )
45
- . digest ( 'base64' )
46
- . replace ( / \/ / g, '_' )
47
- . replace ( / \+ / g, '-' )
48
- . replace ( / = / g, '' )
49
- . substring ( 0 , 10 ) ;
50
-
42
+ const hash = calcFileHash ( pi ) ;
43
+
51
44
const outName = fedOptions . dev
52
- ? `${ encName } .${ hash } -dev.js`
53
- : `${ encName } .${ hash } .js` ;
45
+ ? `${ encName } .${ hash } -dev.js`
46
+ : `${ encName } .${ hash } .js` ;
54
47
55
48
return { fileName : pi . entryPoint , outName } ;
56
49
} ) ;
@@ -145,6 +138,19 @@ export async function bundleShared(
145
138
} ) ;
146
139
}
147
140
141
+ function calcFileHash ( pi : PackageInfo ) {
142
+ const hashBase = pi . version + '_' + pi . entryPoint ;
143
+ const hash = crypto
144
+ . createHash ( 'sha256' )
145
+ . update ( hashBase )
146
+ . digest ( 'base64' )
147
+ . replace ( / \/ / g, '_' )
148
+ . replace ( / \+ / g, '-' )
149
+ . replace ( / = / g, '' )
150
+ . substring ( 0 , 10 ) ;
151
+ return hash ;
152
+ }
153
+
148
154
function copyFileIfExists ( cachedFile : string , fullOutputPath : string ) {
149
155
fs . mkdirSync ( path . dirname ( fullOutputPath ) , { recursive : true } ) ;
150
156
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @softarc/native-federation-esbuild" ,
3
- "version" : " 2.0.9 " ,
3
+ "version" : " 2.0.10 " ,
4
4
"type" : " commonjs" ,
5
5
"dependencies" : {
6
6
"@rollup/plugin-commonjs" : " ^22.0.2" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @softarc/native-federation-runtime" ,
3
- "version" : " 2.0.9 " ,
3
+ "version" : " 2.0.10 " ,
4
4
"peerDependencies" : {},
5
5
"dependencies" : {
6
6
"tslib" : " ^2.3.0"
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @angular-architects/native-federation" ,
3
- "version" : " 18.0.1 " ,
3
+ "version" : " 18.1.0 " ,
4
4
"main" : " src/index.js" ,
5
5
"generators" : " ./collection.json" ,
6
6
"builders" : " ./builders.json" ,
20
20
},
21
21
"dependencies" : {
22
22
"@babel/core" : " ^7.19.0" ,
23
- "@softarc/native-federation" : " 2.0.9 " ,
24
- "@softarc/native-federation-runtime" : " 2.0.9 " ,
23
+ "@softarc/native-federation" : " 2.0.10 " ,
24
+ "@softarc/native-federation-runtime" : " 2.0.10 " ,
25
25
"@types/browser-sync" : " ^2.29.0" ,
26
26
"browser-sync" : " ^3.0.2" ,
27
27
"esbuild" : " ^0.19.5" ,
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ export async function* runBuilder(
127
127
const watch = ! ! runServer || nfOptions . watch ;
128
128
129
129
options . watch = watch ;
130
+ options . baseHref = nfOptions . baseHref ;
130
131
const rebuildEvents = new RebuildHubs ( ) ;
131
132
132
133
const adapter = createAngularBuildAdapter ( options , context , rebuildEvents ) ;
Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ export interface NfBuilderSchema extends JsonObject {
11
11
watch : boolean ;
12
12
skipHtmlTransform : boolean ;
13
13
esmsInitOptions : ESMSInitOptions ;
14
+ baseHref ?: string ;
14
15
} // eslint-disable-line
Original file line number Diff line number Diff line change 43
43
"type" : " boolean" ,
44
44
"default" : false
45
45
},
46
+ "baseHref" : {
47
+ "type" : " string"
48
+ },
46
49
"esmsInitOptions" : {
47
50
"type" : " object" ,
48
51
"description" : " Options for esms-module-shims https://github.com/guybedford/es-module-shims?tab=readme-ov-file#init-options" ,
You can’t perform that action at this time.
0 commit comments