Requires agoda-devfeedback
version 1.0.0 or later.
If you use Webpack, you can add the following to your webpack.config.js
file:
const { WebpackBuildStatsPlugin } = require('agoda-devfeedback');
module.exports = {
// ...
plugins: [
// ...
new WebpackBuildStatsPlugin(),
],
};
If you use Vite you can add the following to your vite.config.js
file:
import { viteBuildStatsPlugin } from 'agoda-devfeedback';
export default defineConfig({
// ...
plugins: [
// ...
viteBuildStatsPlugin(),
],
});
Both Webpack and Vite plugins will not only send the build data but also send the command that you used to run the build like yarn dev
or yarn build
to be the build identifier which should work in most cases in order to help you distinguish between different build configurations.
However, if you would like to define your own identifier, you can do so by passing it as a parameter to the plugin.
new WebpackBuildStatsPlugin('production');
or
viteBuildStatsPlugin('production');