npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

extended-build-manager-webpack-plugin

v1.1.0

Published

Add more functionality to the webpack builder

Downloads

4

Readme

extended-build-manager-webpack-plugin

Manage files and directories (copy, create and delete) run commands and better management of the compilation progress in the console.

Install

npm install extended-build-manager-webpack-plugin --save-dev

Usage

It is included in the same way as all webpack plugins.

Example

In this example, it simulates a situation in which, in addition to compiling the project with webpack, it is uploaded to a staging branch with git.

webpack.config.js:

const ExtendedBuildManagerWebpackPlugin = require('extended-build-manager-webpack-plugin');

module.exports = {
    ...
    ...
    plugins: [
        new ExtendedBuildManagerWebpackPlugin({
            onStart: [
                {
                    "name": "BuildSprites",
                    "title": "Building sprites ...",
                    "description": "Build sprites using the npm plugin",
                    "command": "npm run build:sprites"
                },
                {
                    "name": "PullBranch",
                    "title": "Move to staging branch folder and pull ...",
                    "description": "Pull the current proyect branch in git",
                    "command": "cd ../../staging/myProyect && git pull"
                },
                {
                    "name": "DeleteDistBranchFolder",
                    "title": "Remove dist branch folder ...",
                    "description": "Remove dist branch folder",
                    "distManager": [
                        { delete: [ `../../staging/myProyect/dist` ] }
                    ]
                }
            ],
            onEnd: [
                {
                    "name": "CopyDistFolderToBranch",
                    "title": "Copy dist folder to branch ...",
                    "description": "Copy dist folder to branch",
                    "distManager": [
                        { copy: [ { source: "./dist", destination: "../../staging/myProyect/dist" } ] }
                    ]
                },
                {
                    "name": "CommitBranch",
                    "title": "Commit branch ...",
                    "description": "Commit the current proyect branch in git",
                    "command": `cd ../../staging/myProyect && git add . && git commit -m "deploy to staging"`
                }
            ]
        })
    ]
    ...
}

Options

All these functions help when displaying different messages in the compilation process in the console.

Please complete all the information you can.

Events

These two events run before and after webpack builds, a message will be displayed in the middle when the webpack progress itself is running.

  • onStart: Commands to execute before Webpack begins the bundling process
  • onEnd: Commands to execute after Webpack has finished the bundling process

Information

These three elements will help you understand the messages of the console in the progress of the compilation.

  • name: Name of the process, this must be unique (there should not be two objects with the same name)
  • title: Title of this step in the compilation, this will help you understand what is printed on the console when compiling
  • description: Description of this step in the compilation, this will help you understand what is printed on the console when compiling

Actions

You can use these two types of functions.

Command

Here you can run any command, you can concatenate them in the same way you do in the package.json.

Only string type are supported.

Example: "cd ./dist && nodemon index.js"

Dist Manager

With this action you can manage files or folders.

|Name|Description|Example |:--:|:----------|:-----| |copy|Copy individual files or entire directories from a source folder to a destination folder. Also supports glob pattern |copy: [ { source: 'dist/bundle.js', destination: '/home/web/js/' }] |delete|Delete individual files or entire directories. |delete: ['file.txt', '/path/to']

Tips

  • You can use git and the file manager of this plugin in the commands to update it automatically.
  • If you use Angular SSR (server side rendering) you can handle the different constructions with a series of commands.