Skip to content
Discussion options

You must be logged in to vote

Nova.booting is the correct place to put it from a JS standpoint.

The way I do this is to create a new Nova Asset and do my overrides in there.

Nova::serving($callback) is where scripts are registered within an asset and this works for me.

Nova::serving(function (ServingNova $event) {
    Nova::script('nova-overrides', __DIR__.'/../dist/js/asset.js');
});

I just stick all of my overrides in one asset, but you could do as many assets as you need.

Edit: Just saw your PS, but I will leave the below in for anyone else who is struggling

Also don't forget you actually need to compile your component and then load the webpacked js, there is guidance on this in the Asset documentation but you also…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@piljac1
Comment options

@piljac1
Comment options

@ianrobertsFF
Comment options

@piljac1
Comment options

@ianrobertsFF
Comment options

Answer selected by crynobone
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants