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

@crasman/stage-webpack

v1.25.3

Published

Webpack configs and scripts for Stage / Studio

Downloads

181

Readme

stage-webpack

Webpack bundling processes desgined to work well with Stage / Studio environment

Installation

This is installed automatically if you use @crasman/create-stage-webpack to create new project, also the configuration is taken care of.

To install manually run npm install stage-webpack --save-dev

Configuration

Config file (stage-webpack.config.js) needs to be found in project root folder. See config documentation

You also need to setup linters and build process configuration. Click links for examples on how to use and extend stage-webpack defaults:

These files should be stored in the root of your project.

Service worker setup

If defined (config.files.serviceWorker), we expect to find self.__WB_MANIFEST in the service worker file for precaching built assets. Example service-worker.js setup

Extending stage-webpack.config.js

You can extend project settings with local ones by placing another stage-webpack.config.js file outside of the project folder. This way you can generate valid SSL certificate that you can use for all your stage-webpack dev servers.

Scripts

  • stage-webpack start: Start dev server. Change proxy target with --sw-stage-url <config.stage.urls[target]>. E.g. stage-webpack-scripts start --sw-stage-url admin
  • stage-webpack build: Build files and upload to Studio
  • stage-webpack watch: Dev version of build. Should only be used when dev server can't be used, for example when developing Prince XML which requires that server has access to needed files.
  • stage-webpack update-project: Can be used to apply automatic fixes to source files if there are any available

Client environment variables

Exposed to client:

  • PUBLIC_PATH: Can be used to register service worker etc.
  • NODE_ENV: 'production', 'development' or 'test'
  • DEV_SERVER: undefined or 'true'
  • SW_<anything>: Any env variable prefixed with SW_ can be used in client code. E.g SW_TEST = 'test' can be accessed with process.env.SW_TEST

Development

Linking to test project for Webpack testing

Link @crasman/stage-webpack

Just run npm link inside packages/stage-webpack folder

Link to your test project

This is little tricky to link thanks to how npm link now works (>= 7.0.0). Step 4 works around this new limitation by installing all other monorepo packages as dependencies.

  1. Go to your project's folder
  2. Switch to same Node version as you use for @crasman/stage-webpack developing
  3. Remove node_modules and package-lock.json and run npm install if you needed to change Node version
  4. npm install @crasman/babel-preset-stage-webpack @crasman/branch-bar @crasman/eslint-config-stage-webpack @crasman/stylelint-config-stage-webpack
  5. npm link @crasman/stage-webpack
  6. Start testing Webpack functionality