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

webcompiler

v7.0.1

Published

Lint, type-check, compile, package and gzip JavaScript (ES6 + Flow static types + JSX), for the browser as well as NodeJS; lint, compile, auto-prefix, minify and gzip SASS.

Downloads

169

Readme

webcompiler

NPM

Lint, type-check, compile, package and gzip JavaScript (ES6 + Flow static types + JSX), for the browser as well as NodeJS; lint, compile, auto-prefix, minify and gzip SASS.

Project Home | API Docs | Changelog | Discord

Node.js Version Build Status Coverage Status Code Climate Dependency Status Downloads License

Webpack is an amazing tool, however it requires a lot of boilerplate to properly setup and configure, especially when you use it on more than one project.

ESLint is constantly updated, new rules are added, APIs are changed. Properly configuring it is a routine and time consuming task, which is completely impractical to perform on each project separately.

APIs are sometimes changed without any change in functionality (e.g. Babel 5 vs Babel 6).

This project aims to abstract all of those problems out of the development of applications and provide the simplest possible interface, pre-configured with everything set up and ready to use right after the installation.

babel-polyfill, autoprefixer, fast rebuilds with caching in development, production tree shaking, optimizations and compression that care even about your users public cache, everything completely automatic and baked into the library.

Have fun :)

Feedback

What did you struggle with?

Any feedback on Discord would be greatly appreciated. It does not require registration and won't take more than a few minutes of your time.

Prerequisites

  1. Watchman (only required by the watch function and the DevServer class; you don't need to know how it works, all you need to do is install it)

A note about Facebook Flow

Facebook Flow is a static analysis tool used to check your JavaScript code for possible errors at compile time.

It is very smart at understanding your program code, however you should not rely on it being smart enough to just understand your external dependencies too.

It can do that, the problem is that a typical NodeJS project can contain hundreds of NPM modules, with thousands of JavaScript files.

It is a very complicated task, even for a tool that smart, to parse all of them and stay performant enough to not only be usable but useful as well.

Which is why it must not be allowed to even try to understand any files that reside in a node_modules directory.

Interface Files must be used instead.

You can find examples of such interface files, as well as the interface file for the tool itself, in the interfaces directory.

Installation

npm i webcompiler --save-dev

Production builds

By default all compilation is done in development mode.

If you wish to compile for production just set the NODE_ENV environment variable to "production", the following additional actions will be performed by the compiler:

  1. advanced compilation time optimizations
  2. minification (only fe in production mode)
  3. g-zip compression (only fe in production mode)

Important!

The resulting JavaScript and CSS files from fe in production mode are gzip compressed for performance (see Gzip Components), so make sure to provide a "Content-Encoding" header to the browser (e.g. res.setHeader('Content-Encoding', 'gzip');).

Troubleshooting

watch

  1. If you've installed Watchman on OSX with homebrew and you notice that it suddenly stopped working, try the following:
  • launchctl unload -F ~/Library/LaunchAgents/com.github.facebook.watchman.plist
  • rm -rf /usr/local/var/run/watchman/
  • reinstall Watchman completely
  • if that does not solve your problem or the above steps do not apply to you report a bug describing your operating system version, Watchman version, webcompiler version, and your specific problem