webpack
Add conciv to a webpack app, as a plugin in your development build.
conciv runs in a webpack development build through the plugin from @conciv/it/plugin/webpack.
Prefer to let your agent do it?
Copy this prompt into your coding agent. It runs conciv's init command, which makes the same changes as below.
Set up conciv in this project. conciv is a dev-only AI agent widget for my running app. 1. In my app folder, the one with package.json, run `npx @conciv/cli@latest init --yes`, with pnpm dlx, yarn dlx or bunx instead of npx if the project uses that package manager. Do any step it prints as a snippet yourself. If it stops on uncommitted changes or the install fails, stop and ask me; do not pass --force or change a release age policy yourself. 2. Check that init added conciv() to the plugins of my Vite config. 3. Check that the claude CLI is installed, logged in and on the PATH of the shell that starts the dev server. conciv does not install it or log in; if it is missing, tell me. 4. Start the dev server with my dev script and open the app. A conciv button shows in the corner. Log me in: run `npx @conciv/cli@latest auth link <the app URL>` in the app folder and give me the link it prints, or tell me to click the conciv button and type the 6-digit code the dev server prints.
Add conciv to webpack
Install @conciv/it as a dev dependency:
npm install -D @conciv/itpnpm add -D @conciv/ityarn add --dev @conciv/itbun add --dev @conciv/itAdd the plugin and a development mode to your config:
const HtmlWebpackPlugin = require('html-webpack-plugin')
const conciv = require('@conciv/it/plugin/webpack')
module.exports = {
mode: 'development',
plugins: [
new HtmlWebpackPlugin(),
conciv.default(),
],
}A CommonJS require gets the plugin as .default. Options go in its one argument. Learn more in Configuration.
Start your dev server with npx webpack serve, or a build in watch mode with --watch.
Open your app, click the conciv button, and type the 6-digit code your dev server prints.
conciv runs only outside production
The development and none modes turn conciv on. The production mode turns it off. So does a config with no mode,
because webpack then builds for production. Passing --mode development on the command line works too.
What works
- The dev server, or a watch build, adds the conciv button to every page and starts the engine.
- A one-off development build adds the button only. The engine does not start.
- The chat, the page tools and the plugins work. The dev server tools do not. They answer that no dev server is attached.
An ES module config
In an ES module config, import the plugin and call it directly. init writes this form when your config uses import.
import HtmlWebpackPlugin from 'html-webpack-plugin'
import conciv from '@conciv/it/plugin/webpack'
export default {
mode: 'development',
plugins: [
new HtmlWebpackPlugin(),
conciv(),
],
}Next steps
- Use conciv: what the agent can do in your app.
- Configuration: the options the plugin takes.