1.1.13 • Published 22 days ago

@ideasonpurpose/build-tools-wordpress v1.1.13

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

@ideasonpurpose/build-tools-wordpress

Version 1.1.13

NPM Version GitHub Actions Workflow Status

Build scripts and dependencies for IOP's WordPress development environments.

Config

Each project should have an ideasonpurpose.config.js file in the same directory as package.json. This file should export an object with at least three properties set:

  • src - The source directory containing source files which should be compiled or transposed. The contents of this directory will be omitted from builds.
  • dist - The distribution directory where processed, production-ready files will be output to. All contents of this directory will be included in builds.
  • src - An array of file entry points relative to the src directory. Each entry point will generate a like-named output file. All files and assets imported by a given entry point will be accessible from that entry's corresponding output file.

Versioned Releases

IOP versions our themes so every release creates a clear rollback snapshot. To accomplish this, every milestone build is generated into a versioned directory. This works well for themes where only one can be active, but fails for plugins where multiple versions can be simultaneously enabled so long as their directory names are different.

To work around this, a type property can be added to the config file. When type is plugin, builds will not add the version to directory names.

About This Project

These tools were migrated from our Docker-based WordPress build tools to speed up development and began the process of moving our build tools away from webpack. Gathering dependencies also simplifies the package.json files in host projects, making those slightly more manageable.

The example/webpack.config.js file works best when paired with a PHP environment like our Docker WordPress environments. It's capable of proxying to other servers, but that's sort of crazy.

Additional Notes

This project expects an entirely ES Module based environment and specifies all dependencies using standard ESM import syntax. Projects importing this file should set "type": "module" in their package.json files.

Publishing to npm

A GitHub action will auto-publish version-tagged releases to npm. In order to publish, the repository must have an NPM_TOKEN secret set with the token from npm. Log into npmjs.org with a publish-authorized account, then find the token page linked from the Profile page sidebar. Generate a new token and update the repository secret.

 

Brought to you by IOP

This project is actively developed and used in production at Ideas On Purpose.