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

@denniscual/spinpack

v0.1.5

Published

Spinpack is a CLI tool that turbocharges the developer server experience for CRA projects with Rspack

Downloads

1

Readme

Spinpack

Spinpack is a CLI tool that turbocharges the developer server experience for CRA projects with Rspack, a lightning-fast, Rust-based bundler.

Motivation

Spinpack was designed to modernize the development experience for Create React App (CRA) users struggling with performance issues due to Webpack. By integrating Rspack, a fast, rust-based bundler, this tool accelerates development and modernizes your project’s tech stack without altering your workflow. It leverages Rsbuild, the Rspack powered build tool, to quickly spin up developer servers. This solution ensures developers remain productive and efficient, maintaining familiarity while benefiting from improved performance.

Usage

Initializing a Project

To prepare your project to use Webpack and Rspack, run:

npx @denniscual/spinpack init

This command will:

  • Create an rsbuild.config.ts configuration file in your project directory to spin-up an Rspack dev server.
  • Install necessary dependencies for RSPack.
  • Update your .gitignore to exclude the appropriate files.

Starting the Development Server

To start the development server, use:

npx @denniscual/spinpack start

Options:

  • -rs, --rspack: Use Rspack for the development server.
  • -cr, --craco: Use CRACO, custom create-react-app webpack config, for the development server.
  • --react-scripts: Use React Scripts, default create-react-app webpack config, for the development server (default).

Example:

npx @denniscual/spinpack start --rspack

This will start the development server using Rspack. If no option is provided, Webpack will be used by default.

Frequently Asked Questions (FAQ)

How does Spinpack handle configuration settings between CRA and Rspack?

Spinpack enhances the development experience by aligning Rspack configurations with Create React App’s (CRA) environment variables. By treating CRA’s configurations as the source of truth, Spinpack automatically applies these settings to Rspack, eliminating the need for separate configuration efforts. This approach not only simplifies development by minimizing configuration duplication but also ensures consistent settings across both tools. For example, changing the server port via CRA’s PORT environment variable will automatically adjust the port for Rspack when using Spinpack:

Define in .env file

# Set the development server port to 3001
PORT=3001

Start dev server with Rspack

npx @denniscual/spinpack start --rspack

This streamlined configuration process ensures that developers can focus on their code, not on managing tool settings.

Currently, updating Rspack, rsbuild.config.ts, configurations and expecting them to reflect in CRA’s Webpack configuration is not supported. However, we are exploring the possibility of enabling this in future updates.

Does Spinpack support production builds?

Currently, Spinpack is focused exclusively on enhancing the development server experience. This ensures that developers can use Spinpack to quickly spin up a development environment using either CRA Webpack Config or Rspack without affecting the existing production build process.

Spinpack does generate a build configuration file, rsbuild.config.ts, within the project, which developers can fine-tune for production use. However, because projects often have unique requirements such as the need for specific Webpack plugins when leveraging CRACO or other similar tools for customization—this generated config might require further adjustments to fully meet production standards.

We highly consider adding support for production environments through Spinpack in future updates. This would streamline the process of using the tool's configurations directly for production builds, potentially reducing the need for extensive custom setups.

License

MIT © denniscual