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

@josias-r/wpds-scripts

v3.2.2

Published

WordPack Dev Server scripts

Downloads

12

Readme

WordPack Dev Server

Development with WordPress made easy.

Features

  • SCSS: Modular CSS with variables and functions

  • Modern JavaScript: Write Javascript using the latest syntax.

  • Modular JavaScript: Split your JS files into multiple module files for better organization and import NPM libraries.

  • HMR: Watch your changes live getting hot reloaded while developing

  • Browser support: With the help of Babel and Browserslist everything will be compiled to support old Browsers

  • Linters: Prettier, ESLint and stylelint will help you while developing. (Make sure you have the corresponding packages installed for your editor)

    Note: You should install the corresponding packages for your Editor to make full use of this feature.

    Note: I'm not following the WordPress Coding Standards for JS and CSS out of preference (I think they are outdated and rather use the recommended prettier/eslint configurations). You can always change that by updating the linter rc files.

  • Customizable: You have a lot of options you can configure. see configuration

Pro Tip: Since wpds-scripts will open a proxy, you can even work on a webpage that is already online, as long as you are just changing static files, like JS and CSS.

CLI Configuration

  • -p or --port: default: 8080
    • The port on which you can preview your changes
  • -h or --host: default: localhost
    • The host on which you can preview your changes
  • -P or --proxy: default: http://localhost:8000
    • The URL (include http://) on which your local WordPress installation runs on.
    • If you are only making small changes to an no-local website css and js should get hot-loaded anyway.
  • --publicPath: default: /wp-content/themes/FOLDER_BASENAME
    • The path where your proxied files are available.

Config File Configuration

To configure wpds-scripts you need to create the wpds-scripts.config.js file inside your project root folder.

Inside it you can override the following options from the default config:

{
  verbose: false, // boolean -> set to true to recieve more console logs
  port: 8080, // number -> dev server port
  host: "localhost", // string -> dev server hostname
  proxy: "http://localhost:8000", // string -> the URL to which the dev server will redirect to (include the http protocol!)
  publicPath: `/wp-content/themes/${path.basename(process.cwd())}`, // string -> the path where your files are exposed to public
  entryFiles: [`${process.cwd()}/src/javascripts/main.js`], // array of strings -> files which are getting bundled (import stylesheets from withing those files, don't load them here!)
  customRules: [], // array -> custom rules that should be added to webpack
  customExternals: [], // array -> custom external dependencies that webpack should ignore when bundling (@wordpress/** packages are already ignored)
  customWebpackConfig: false, // object | false -> object that will override the webpack config (only use this if the above configurations do not suffice!)
  customWebpackDevConfig: false // object | false -> object that will override the webpack dev server config (only use this if the above configurations do not suffice!)
}

Example:

module.exports = {
  verbose: true,
  port: 8081,
}

Note: The CLI parameters will always override configuration from your wpds-scripts.config.js file.

Note: wpds-scripts will use your .babelrc, .eslintrc and .stylelintrc when those files are present.

Donate

You can buy me a cup of coffee, if you'd like ^^

Donate