Skip to Content
Recipes

Keep conciv out of production

Make sure no deployed build carries the widget or starts the engine.

Problem

conciv is a development tool. You want it nowhere near what you deploy. The question comes up when:

  • you deploy a staging build made in development mode;
  • you run the dev server on a shared machine, for a demo or a review;
  • you are not sure what each bundler does in a production build.

A deployed widget is a dead button

The engine listens on 127.0.0.1 only. It answers only browsers that logged in. A widget on a deployed page cannot reach it, so visitors see a button that never works.

Solution

A production build already leaves conciv out, on every bundler:

  • Vite: conciv runs with the dev server only. vite build never includes it.
  • Next.js: with NODE_ENV set to production, no engine starts and the widget does not mount.
  • webpack and Rspack: conciv runs only when mode is development or none. With no mode, the build is a production build, so conciv is off.

For any other build you deploy, turn conciv off with enabled. Read it from a variable your deploy already sets:

vite.config.ts
import {} from 'vite'
import  from '@conciv/it/plugin/vite'

export default ({
  : [
    ({
      : .. !== '1', // <- off in the staging build, on everywhere else
    }),
  ],
})

With enabled: false, no engine starts and no widget is added. The same option works on every bundler. Learn more in the Configuration documentation.

Next steps

On this page