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 11{
22 "name" : " @softarc/native-federation" ,
3- "version" : " 2.0.9 " ,
3+ "version" : " 2.0.10 " ,
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.9 "
9+ "@softarc/native-federation-runtime" : " 2.0.10 "
1010 }
1111}
Original file line number Diff line number Diff line change @@ -39,18 +39,11 @@ export async function bundleShared(
3939 // ? `${encName}-${encVersion}-dev.js`
4040 // : `${encName}-${encVersion}.js`;
4141
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+
5144 const outName = fedOptions . dev
52- ? `${ encName } .${ hash } -dev.js`
53- : `${ encName } .${ hash } .js` ;
45+ ? `${ encName } .${ hash } -dev.js`
46+ : `${ encName } .${ hash } .js` ;
5447
5548 return { fileName : pi . entryPoint , outName } ;
5649 } ) ;
@@ -145,6 +138,19 @@ export async function bundleShared(
145138 } ) ;
146139}
147140
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+
148154function copyFileIfExists ( cachedFile : string , fullOutputPath : string ) {
149155 fs . mkdirSync ( path . dirname ( fullOutputPath ) , { recursive : true } ) ;
150156
Original file line number Diff line number Diff line change 11{
22 "name" : " @softarc/native-federation-esbuild" ,
3- "version" : " 2.0.9 " ,
3+ "version" : " 2.0.10 " ,
44 "type" : " commonjs" ,
55 "dependencies" : {
66 "@rollup/plugin-commonjs" : " ^22.0.2" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @softarc/native-federation-runtime" ,
3- "version" : " 2.0.9 " ,
3+ "version" : " 2.0.10 " ,
44 "peerDependencies" : {},
55 "dependencies" : {
66 "tslib" : " ^2.3.0"
Original file line number Diff line number Diff line change 11{
22 "name" : " @angular-architects/native-federation" ,
3- "version" : " 18.0.1 " ,
3+ "version" : " 18.1.0 " ,
44 "main" : " src/index.js" ,
55 "generators" : " ./collection.json" ,
66 "builders" : " ./builders.json" ,
2020 },
2121 "dependencies" : {
2222 "@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 " ,
2525 "@types/browser-sync" : " ^2.29.0" ,
2626 "browser-sync" : " ^3.0.2" ,
2727 "esbuild" : " ^0.19.5" ,
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ export async function* runBuilder(
127127 const watch = ! ! runServer || nfOptions . watch ;
128128
129129 options . watch = watch ;
130+ options . baseHref = nfOptions . baseHref ;
130131 const rebuildEvents = new RebuildHubs ( ) ;
131132
132133 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 {
1111 watch : boolean ;
1212 skipHtmlTransform : boolean ;
1313 esmsInitOptions : ESMSInitOptions ;
14+ baseHref ?: string ;
1415} // eslint-disable-line
Original file line number Diff line number Diff line change 4343 "type" : " boolean" ,
4444 "default" : false
4545 },
46+ "baseHref" : {
47+ "type" : " string"
48+ },
4649 "esmsInitOptions" : {
4750 "type" : " object" ,
4851 "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