Skif
Skif

Reputation: 1308

How to insert custom node script to Nuxt app?

I need to add a custom nodejs script to the project that performs a few manipulations on icon files before build and before starting development.

What is a good place to add it? Maybe in nuxt.config.js or in some other place

Upvotes: 0

Views: 399

Answers (1)

Yasio
Yasio

Reputation: 490

in your nuxt.config.js

{
  ...,
  hooks: {
    build: {
      before(nuxt, buildOptions) {
        // your logic here
      }
    }
  },
  ...
}

More about nuxt hooks: https://nuxtjs.org/docs/configuration-glossary/configuration-hooks/

More builder hooks: https://nuxtjs.org/docs/internals-glossary/internals-builder/#hooks

Upvotes: 1

Related Questions