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

@webmunk/cwe-template-webpack

v1.0.38

Published

webpack-based build for webmunk extensions

Downloads

15

Readme

The webpack build template

This template is the default template used by the create-webmunk-ext script to create an initial tree structure. As the name indicates, this template aims at engineers eager to use webpack for building their extension. The tree structure includes the following set of files/directories:

├───📁 assets/
│   └───...
├───📁 deliveries/ (where production builds end-up, ie zip files that can be uploaded in CWS) 
│   └───...
├───📁 dist/ (where webpack generates the bundled scripts)
│   └───...
├───📁 src/ (where you include all your scripts ie worker, content, etc ...)
│   └───...
├───📄 webpack.addon.config.base.js
└───📄 webpack.addon.config.dev.js

Regarding the src folder, 4 sub-folders are included with the appropriate js files:

├───📁 background/
│   └───📄 worker.js
├───📁 chrome/
│   └───📄 baseManifest.json
├───📁 content/
│   └───📄 content.js
└───📁 options/
    └───📄 options.js

Those are the files used by the webpack build process to generate the corresponding extension scripts. This is where the developer will import the webmunk extension modules files.

  • chrome/baseManifest.json is a manifest to be modified by the developer and includes new elements related to the final extension itself. The manifest.json "real" file will be built from this file and the manifest files of the webmunk extension modules.

The template brings a few webpack configs which are used to build the extension.

  • webpack.addon.config.base is the config used by all other webpack configs and include the targets, the assets to copy.
  • webpack.addon.config.dev is the config to buid a development version for usage in unpackaged mode. It customizes the base webpack config.
  • webpack.addon.config.prod is the config to build a production version. End-product is the zip extension file.

Available Scripts

In the project directory, you can run:

npm run addon:dev:hot

Creates in /dist an unpackaged version of the extension in development mode.

npm run addon:build:dev

Creates in /deliveries a zipped version of the extension in dev mode.

npm run addon:build:prod

Creates in /deliveries a zipped version of the extension in production mode. Zip file can be uploaded on Chrome Web store.

Note: those scripts will also display a consolidated list of justifications for the permissions required by the imported webmunk extension modules. This info aims at facilitating the registration of the extension in the CWS (Chrome Web Store).

Importing a webmunk module

Refer to the README.md file of the webmunk extension module.