@@ -184,6 +184,12 @@ jobs:
184184 gsub(/LIT_VERSION/, version);
185185 print
186186 }' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/lit-redirect.html.template > cdn/lit/index.html
187+
188+ # Create JavaScript redirect file for importmap compatibility
189+ awk -v version="$LIT_VERSION" '{
190+ gsub(/\${VERSION}/, version);
191+ print
192+ }' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/package-root-js.template > cdn/lit/index.js
187193
188194 # Get Lit dependencies using the script
189195 echo "Processing Lit dependencies..."
@@ -219,6 +225,12 @@ jobs:
219225 gsub(/\${PACKAGE_NAME}/, pkgname);
220226 print
221227 }' scripts/helpers/latest-redirect.html.template > "cdn/$dep/index.html"
228+
229+ # Create JavaScript redirect file for importmap compatibility
230+ awk -v version="$DEP_VERSION" '{
231+ gsub(/\${VERSION}/, version);
232+ print
233+ }' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/package-root-js.template > "cdn/$dep/index.js"
222234 fi
223235 done
224236
@@ -300,6 +312,12 @@ jobs:
300312 gsub(/\${PACKAGE_NAME}/, pkgname);
301313 print
302314 }' scripts/helpers/latest-redirect.html.template > cdn/@semantic-ui/core/index.html
315+
316+ # Create JavaScript redirect file for importmap compatibility
317+ awk -v version="$CORE_VERSION" '{
318+ gsub(/\${VERSION}/, version);
319+ print
320+ }' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/package-root-js.template > cdn/@semantic-ui/core/index.js
303321
304322 # Create redirects for each package
305323 cd packages
@@ -316,6 +334,12 @@ jobs:
316334 gsub(/\${PACKAGE_NAME}/, pkgname);
317335 print
318336 }' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/latest-redirect.html.template > "../cdn/@semantic-ui/$package_name/index.html"
337+
338+ # Create JavaScript redirect file for importmap compatibility
339+ awk -v version="$pkg_version" '{
340+ gsub(/\${VERSION}/, version);
341+ print
342+ }' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/package-root-js.template > "../cdn/@semantic-ui/$package_name/index.js"
319343 done
320344 cd ..
321345
0 commit comments