Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@fiverr/afterbuild-webpack-plugin

fiverr7.6kMIT1.0.0

A webpack plugin that registers a script to run after the build has finished

webpack, webpack-plugin, build, after-build, post-build

readme

npm node

AfterBuild Webpack Plugin

A webpack plugin that registers a script to run after the build has finished

Requirements

This module requires a minimum of Node 8.

Getting Started

First, install the plugin as a dev dependency:

$ npm i @fiverr/afterbuild-webpack-plugin -D

Then add it to the list of plugins in your webpack config:

const AfterBuildPlugin = require('@fiverr/afterbuild-webpack-plugin');

module.exports = {
    plugins: [
        new AfterBuildPlugin(doSomething)
    ]
};

Arguments

The plugin receieves one argument - a callback function to run once the build has finished.

Example - Send a Slack notification post-build

const { WebClient } = require('@slack/web-api');
const AfterBuildPlugin = require('@fiverr/afterbuild-webpack-plugin');

const slackClient = new WebClient('YOUR_SLACK_TOKEN');

const sendSlackNorification = () => {
    slackClient.chat.postMessage({
        text: 'Build passed successfully!',
        channel: 'webpack-builds'
    });
}

module.exports = {
    plugins: [
        new AfterBuildPlugin(doSomething)
    ]
};

changelog

CHANGELOG.md

1.0.0 (May 27, 2020)

The package's first stable version.