Skip to content

Webpack

  1. Install the package:

    Terminal window
    npm install aeo.js
  2. Add the plugin to your Webpack config:

    webpack.config.js
    const { AeoWebpackPlugin } = require('aeo.js/webpack');
    module.exports = {
    plugins: [
    new AeoWebpackPlugin({
    title: 'My Site',
    description: 'A site optimized for AI discovery',
    url: 'https://mysite.com',
    }),
    ],
    };

The Webpack plugin:

  • Runs during the emit phase of the Webpack compilation
  • Generates all AEO files in your output directory
  • Injects the widget into your HTML entry point

Pass any AeoConfig options to the plugin:

new AeoWebpackPlugin({
title: 'My Site',
url: 'https://mysite.com',
widget: {
enabled: true,
position: 'bottom-right',
},
});