Skip to content

[6.x] Add configuring callback functionality to statamic.js#13811

Open
maurice-ellis wants to merge 1 commit intostatamic:6.xfrom
maurice-ellis:feature/statamic-configuring-callback
Open

[6.x] Add configuring callback functionality to statamic.js#13811
maurice-ellis wants to merge 1 commit intostatamic:6.xfrom
maurice-ellis:feature/statamic-configuring-callback

Conversation

@maurice-ellis
Copy link

An additional callback is needed to configure the Vue app before it's mounted, adding globalProperties and plugins, since this cannot be done after the app is mounted.

An additional callback is needed to be able to configure the app before it's mounted to add additional globalProperties and plugins since it cannot be done after the app is mounted.
@maurice-ellis maurice-ellis changed the title Add configuring callback functionality to statamic.js [6.x] Add configuring callback functionality to statamic.js Feb 4, 2026
@jasonvarga
Copy link
Member

Can you show an example of what you plan to do with this?

@maurice-ellis
Copy link
Author

Yes, @jasonvarga, something like this in my V6 addon I'm working on. I tried looking at the code to see if there was another way and I couldn't find anything. Boot is called before the app is created and booted is called after the app is already mounted.

Statamic.configuring(() => {
    Statamic.$app.use(Plugin);
    Statamic.$app.use(PerfectScrollbarPlugin);

    Object.assign(Statamic.$app.config.globalProperties, {
        $something: something,
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants