Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.18 KB

BUILD_TIME.md

File metadata and controls

55 lines (38 loc) · 1.18 KB

Build Time (Compilation Time)

Requires agoda-devfeedback version 1.0.0 or later.

Usage

Basic usage

Webpack

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(),
  ],
};

Vite

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(),
  ],
});

Advanced usage

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');