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

wasm-webpack-sources

v0.2.13

Published

Source code handling classes for webpack

Downloads

16

Readme

wasm-webpack-sources

The rust implementation of webpack-sources with WebAssembly Node.js API.

Usage

1. With webpack-cli (Recommend)

First, install webpack-cli, webpack, and wasm-webpack-sources in your local project:

npm install webpack wasm-webpack-sources https://github.com/jevancc/webpack-cli

After the installation, you can try the experimental WebAssembly package with argument -r wasm-webpack-sources:

npx webpack -r wasm-webpack-sources

When the module is successfully loaded, you will see the following message:

Override:
    <webpack-sources resolve> -> <wasm-webpack-sources resolve>
You are now using experimental package `wasm-webpack-sources`

2. With cloned webpack repository

You can install this package with yarn under an alias to try it with your local Webpack:

yarn add webpack-sources@npm:wasm-webpack-sources

This command will replace webpack-soruces with wasm-webpack-sources in node_modules.

Important Notice

  • The size of file is stored in 32bit signed integer, hence this package does not support files larger than 2GB.
  • In order to use this package you will need Node.js version 8 or above.

FAQ

1. Do I need to modify webpack or my plugins to try this package?

No. The API of this package is 100% compatible with the JS package webpack-sources. You just need to override the requiring of webpack-sources with wasm-webpack-sources and everything can work perfectly.

2. How you handle deallocation?

There is no deallocation in current release.

The deallocation process invloves extra works to be made in webpack and plugins which use and create objects with webpack-sources. So far, these works haven't be done so it may impose the potential risk of memory leak.

Be careful when you are using it in the cases where process is not exited after the compilation such as dev-server.

Build

The released npm package and this repository contains the latest WebAssembly binary, so there is no need for you to build the binary yourself to use it unless you want to test it.

This package is written in Rust with wasm-bindgen. To build the WebAssembly on your own, you need to install the requirements:

  • Rust nightly
  • wasm32-unknown-unknown target
  • wasm-bindgen

You can follow the guide of wasm-bindgen to setup everything you need.

After the enviroment is set-up, you can build the WebAssembly binary with the npm script:

npm run build:wasm

This script will place the binary and JS interface generated by wasm-bindgen in wasm-api/build.

Reference