Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace complex webpack build process with @wordpress/scripts #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

2ndkauboy
Copy link
Contributor

PR #61 aims to make compilations possible with an older version of node.js but I think the biggest issue with the current plugin is the complex directory layout and build process by using webpack directly.

This PR aims to replace it with @wordpress/scripts while also turning the plugin directory layout into a standard WordPress plugin, so it's no longer necessary to clone it to a random directory and symlinking the dist folder (under a different name) into the wp-content/plugins folder on the WordPress installation, you want to use it in.

It also dramatically reduces the number of NPM dependencies, making future developments easier.

🚨 This is a huge breaking change though, given that the directory structure changes, so anyone using it would have to replace the symlink with the plugin directly!

@zzap
Copy link
Member

zzap commented Aug 26, 2022

This is a big step forward and definitely the right way to go. Great work 🙌

@ironprogrammer
Copy link

Nice! 🙌🏻 This update works on my machine...😂

I cleared out the old node_modules folder prior to npm install to avoid a build error. I'd previously used v14. Successfully ran npm run build under v17 🚀

  • OS: macOS 12.5.1
  • Browser: Safari 15.6.1
  • PHP: 7.4.30
  • WordPress: wordpress-develop:trunk

Regarding the directory structure changes, note that users can still utilize a symlink, e.g. from the updated root of this project run:

ln -s "$PWD" ~/path-to-wordpress/wp-content/plugins/contributor-orientation-tool

After re-linking and the initial page load with the plugin active, I refreshed and WordPress figured out the new path.

I'll close out #61 in favor of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants