Skip to content

Commit

Permalink
grunt update from daily grunt work
Browse files Browse the repository at this point in the history
  • Loading branch information
phet-dev committed Feb 4, 2025
1 parent bc35125 commit c96c8b2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion dot-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@
'../chipper/js/browser/sim-tests/qunit-connector.js'
];

const query = new URLSearchParams( window.location.search );
const esbuild = !!query.has( 'esbuild' );
const liveReload = !!query.has( 'liveReload' );

// RichText imports himalaya but it is skipped by esbuild, so we add it as a preload here.
// see https://github.com/phetsims/scenery/issues/1583 and https://github.com/phetsims/chipper/issues/1409 and https://github.com/phetsims/membrane-channels/issues/6#issuecomment-2631403462
if ( esbuild ) {
preloads.push( '../sherpa/lib/himalaya-1.1.0.js' );
}

if ( brand === 'phet-io' ) {
preloads = preloads.concat( [
'../phet-io/js/phet-io-initialize-globals.js'
Expand All @@ -120,9 +130,16 @@
// Queue all of the preloads to be loaded.
preloads.forEach( preload => loadURL( preload ) );

const targetSource = esbuild ? './dist/bundle.js' : '../chipper/dist/js/dot/js/dot-tests.js';

// Module loading in compilation-free (development) mode will be kicked off once strings are loaded.
// This is done in load-unbuilt-strings.js
window.phet.chipper.loadModules = () => loadURL( '../chipper/dist/js/dot/js/dot-tests.js', 'module' );
window.phet.chipper.loadModules = () => loadURL( targetSource, 'module' );

// Live reload, see https://esbuild.github.io/api/#live-reload
if ( liveReload ) {
new EventSource( '/esbuild' ).addEventListener( 'change', () => location.reload() );
}
</script>
</body>
</html>

0 comments on commit c96c8b2

Please sign in to comment.