Frontend Instrumentation (static)
2
Instrument the build
Command syntax
npx slnodejs instrument \
--tokenFile ./sltoken.txt \
--buildSessionIdFile buildSessionId \
--scanDir dist \
--outputPath sl_dist \
--labId <Lab ID> \
--splitPreambleIntoFile \
--failOnError- name: SeaLights instrument (frontend)
run: |
npx slnodejs instrument \
--token "${{ secrets.SL_TOKEN }}" \
--buildSessionIdFile buildSessionId \
--scanDir dist \
--outputPath sl_dist \
--splitPreambleIntoFile \
--failOnErrornpx slnodejs instrument `
--tokenFile .\sltoken.txt `
--buildSessionIdFile buildSessionId `
--scanDir dist `
--outputPath sl_dist `
--labId <Lab ID> `
--splitPreambleIntoFile `
--failOnError3
Deploy the instrumented output
Basic deployment
mv dist dist_original
mv sl_dist dist
# Alternative: symbolic link (avoids renaming back later)
# ln -s sl_dist dist- name: Deploy instrumented build (swap)
run: |
mv dist dist_original
mv sl_dist dist
# Then deploy the dist folder to your test environmentRename-Item dist dist_original
Rename-Item sl_dist dist- script: |
mv dist dist_original
mv sl_dist dist
displayName: Swap instrumented build into placeValidate the result
Extra information
Parameters
Parameter
Purpose
Last updated
Was this helpful?

