A CLI dashboard for webpack dev server
Installations
npm install webpack-dashboard
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=8.0.0
Node Version
18.16.0
NPM Version
9.5.1
Score
56.3
Supply Chain
60.9
Quality
80.5
Maintenance
100
Vulnerability
97.7
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
FormidableLabs
Download Statistics
Total Downloads
15,772,814
Last Day
2,219
Last Week
17,910
Last Month
92,992
Last Year
1,154,063
GitHub Statistics
13,865 Stars
278 Commits
363 Forks
198 Watching
18 Branches
109 Contributors
Bundle Size
367.46 kB
Minified
109.26 kB
Minified + Gzipped
Package Meta Information
Latest Version
3.3.8
Package Id
webpack-dashboard@3.3.8
Unpacked Size
50.97 kB
Size
15.36 kB
File Count
16
NPM Version
9.5.1
Node Version
18.16.0
Publised On
18 May 2023
Total Downloads
Cumulative downloads
Total Downloads
15,772,814
Last day
-47.2%
2,219
Compared to previous day
Last week
-13.5%
17,910
Compared to previous week
Last month
-3.2%
92,992
Compared to previous month
Last year
-15%
1,154,063
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
10
Peer Dependencies
1
Dev Dependencies
23
A CLI dashboard for your webpack dev server
What's this all about?
When using webpack, especially for a dev server, you are probably used to seeing something like this:
That's cool, but it's mostly noise and scrolly and not super helpful. This plugin changes that. Now when you run your dev server, you basically work at NASA:
Install
1$ npm install --save-dev webpack-dashboard 2# ... or ... 3$ yarn add --dev webpack-dashboard
ℹ️ Note: You can alternatively globally install the dashboard (e.g.
npm install -g webpack-dashboard
) for use with any project and everything should work the same.
Use
webpack-dashboard@^3.0.0
requires Node 8 or above. Previous versions support down to Node 6.
First, import the plugin and add it to your webpack config:
1// Import the plugin: 2const DashboardPlugin = require("webpack-dashboard/plugin"); 3 4// Add it to your webpack configuration plugins. 5module.exports = { 6 // ... 7 plugins: [new DashboardPlugin()]; 8 // ... 9};
Then, modify your dev server start script previously looked like:
1"scripts": { 2 "dev": "node index.js", # OR 3 "dev": "webpack-dev-server", # OR 4 "dev": "webpack", 5}
You would change that to:
1"scripts": { 2 "dev": "webpack-dashboard -- node index.js", # OR 3 "dev": "webpack-dashboard -- webpack-dev-server", # OR 4 "dev": "webpack-dashboard -- webpack", 5}
Now you can just run your start script like normal, except now, you are awesome. Not that you weren't before. I'm just saying. More so.
Customizations
More configuration customization examples can be found in our getting started guide.
For example, if you want to use a custom port of webpack-dashboard
to communicate between its plugin and CLI tool, you would first set the number in the options object in webpack configuration:
1plugins: [new DashboardPlugin({ port: 3001 })];
Then, you would pass it along to the CLI to match:
1$ webpack-dashboard --port 3001 -- webpack
⚠️ Warning: When choosing a custom port, you need to find one that is not already in use. You should not choose one that is being used by
webpack-dev-server
/devServer
or any other process. Instead, pick one that is only forwebpack-dashboard
and pair that up in the plugin configuration and CLI port flag.
Run it
Finally, start your server using whatever command you have set up. Either you have npm run dev
or npm start
pointed at node devServer.js
or something along those lines.
Then, sit back and pretend you're an astronaut.
Supported Operating Systems and Terminals
macOS → Webpack Dashboard works in Terminal, iTerm 2, and Hyper. For mouse events, like scrolling, in Terminal you will need to ensure View → Enable Mouse Reporting is enabled. This is supported in macOS El Capitan, Sierra, and High Sierra. In iTerm 2, to select full rows of text hold the ⌥ Opt key. To select a block of text hold the ⌥ Opt + ⌘ Cmd key combination.
Windows 10 → Webpack Dashboard works in Command Prompt, PowerShell, and Linux Subsystem for Windows. Mouse events are not supported at this time, as discussed further in the documentation of the underlying terminal library we use Blessed. The main log can be scrolled using the ↑, ↓, Page Up, and Page Down keys.
Linux → Webpack Dashboard has been verified in the built-in terminal app for Debian-based Linux distributions such as Ubuntu or Mint. Mouse events and scrolling are supported automatically. To highlight or select lines hold the ⇧ Shift key.
API
webpack-dashboard (CLI)
Options
-c, --color [color]
- Custom ANSI color for your dashboard-m, --minimal
- Runs the dashboard in minimal mode-t, --title [title]
- Set title of terminal window-p, --port [port]
- Custom port for socket communication server-a, --include-assets [string prefix]
- Limit display to asset names matching string prefix (option can be repeated and is concatenated tonew DashboardPlugin({ includeAssets })
options array)
Arguments
[command]
- The command you want to run, i.e. webpack-dashboard -- node index.js
Webpack plugin
Options
host
- Custom host for connection the socket clientport
- Custom port for connecting the socket clientincludeAssets
- Limit display to asset names matching string prefix or regex (Array<String | RegExp>
)handler
- Plugin handler method, i.e.dashboard.setData
Note: you can also just pass a function in as an argument, which then becomes the handler, i.e. new DashboardPlugin(dashboard.setData)
Local Development
We've standardized our local development process for webpack-dashboard
on using yarn
. We recommend using yarn 1.10.x+
, as these versions include the integrity
checksum. The checksum helps to verify the integrity of an installed package before its code is executed. 🚀
To run this repo locally against our provided examples, take the usual steps.
1yarn 2yarn dev
We re-use a small handful of the fixtures from inspectpack
so that you can work locally on the dashboard while simulating common node_modules
dependency issues you might face in the wild. These live in /examples
.
To change the example you're working against, simply alter the EXAMPLE
env variable in the dev
script in package.json
to match the scenario you want to run in /examples
. For example, if you want to run the tree-shaking
example, change the dev
script from this:
1$ cross-env EXAMPLE=duplicates-esm \ 2 node bin/webpack-dashboard.js -- \ 3 webpack-cli --config examples/config/webpack.config.js --watch
to this:
1$ cross-env EXAMPLE=tree-shaking WEBPACK_MODE=production \ 2 node bin/webpack-dashboard.js -- \ 3 webpack-cli --config examples/config/webpack.config.js --watch
Then just run yarn dev
to get up and running. PRs are very much appreciated!
Contributing
Please see our contributing guide.
Credits
Module output deeply inspired by: https://github.com/robertknight/webpack-bundle-size-analyzer
Error output deeply inspired by: https://github.com/facebookincubator/create-react-app
Maintenance Status
Active: Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 5/19 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: jobLevel 'deployments' permission set to 'write': .github/workflows/release.yml:15
- Warn: jobLevel 'packages' permission set to 'write': .github/workflows/release.yml:16
- Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:11
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/FormidableLabs/webpack-dashboard/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/FormidableLabs/webpack-dashboard/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/FormidableLabs/webpack-dashboard/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/FormidableLabs/webpack-dashboard/release.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/FormidableLabs/webpack-dashboard/release.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 19 are checked with a SAST tool
Reason
25 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-273r-mgr4-v34f
- Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w
- Warn: Project is vulnerable to: GHSA-q9mw-68c2-j6m5
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj
- Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq
- Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
2.7
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More