BLACK FRIDAY - Get 35% off your Mastering Nuxt license!

Client Only Plugins

In this example:

plugins/client-only.client.js uses the window.alert() function which is not available on server side.

nuxt.config.js contains the plugins property which registers the plugin on the client side by adding the .client extension.

Learn more in the Directory Structure book in the plugins chapter.

Loading CodeSandbox...