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

piral-cli-webpack

v1.0.1

Published

Provides debug and build capabilities for pilets and Piral instances using Webpack v4.

Downloads

2,650

Readme

Piral Logo

Piral CLI Webpack · GitHub License npm version tested with jest Gitter Chat

This plugin enables using Webpack v4 as the bundler for Piral instances and pilets.

Installation

Use your favorite npm client for the installation:

npm i piral-cli-webpack --save-dev

Note: If you don't install any bundler for use in piral-cli then piral-cli-webpack will be automatically installed for you.

Using

There is nothing to do. Standard commands such as piral build or pilet debug will now work with Webpack as the bundler.

This plugin comes with batteries included. You don't need to install or specify your Webpack version.

What's Inside

Right now it includes:

  • babel-loader,
  • css-loader,
  • file-loader,
  • source-map-loader,
  • sass-loader,
  • style-loader,
  • ts-loader,
  • parcel-codegen-loader,
  • piral-instance-webpack-plugin,
  • pilet-webpack-plugin,
  • html5-entry-webpack-plugin,
  • import-maps-webpack-plugin,
  • html-webpack-plugin,
  • mini-css-extract-plugin,
  • optimize-css-assets-webpack-plugin,
  • terser-webpack-plugin,
  • webpack, and
  • webpack-dev-server.

As such it should be prepared to include assets (images, videos, ...), stylesheets (CSS and SASS), and work with TypeScript.

Customizing

You can still leverage your own webpack.config.js. Either just export what you want to have overwritten, e.g.,

module.exports = {
  devtool: 'inline-source-map',
};

or specify a function that is called with the already created configuration.

An example would be:

module.exports = function(config) {
  config.plugins.push(myAwesomePlugin);
  config.entry.side = ['@babel/polyfill'];
  return config;
};

Otherwise, you can also use the extend-config helper module to get the job done without having to know the internals:

const extendConfig = require('piral-cli-webpack/extend-config');

module.exports = extendConfig({
  checkTypes: true, // not only transpiles TS, but also checks the types
  noPresets: true, // removes existing presets from Babel
  rules: [], // adds additional rules
  removeRules: [], // removes the rules mentioned by their loader name
  plugins: [], // adds additional plugins
  removePlugins: [], // removes the plugins mentioned by their class reference
  fileLoaderOptions: {}, // sets the options for the file loader
  tsLoaderOptions: {}, // sets the options for the TS loader
  babelLoaderOptions: {}, // sets the options for the Babel loader
  cssLoaderOptions: {}, // sets the options for the CSS loader
  sassLoaderOptions: {}, // sets the options for the SASS loader
});

If you want to name your Webpack configuration different than webpack.config.js you can use the --config CLI option.

Example:

npx piral build --config my-webpack.js

License

Piral is released using the MIT license. For more information see the license file.