Skip to content

Conversation

@erikyo
Copy link

@erikyo erikyo commented Aug 8, 2022

Summary

This pull request enables the use of wp-scripts in order to compile ES to JS. This intrinsically brings many improvements, among them code minification, transpilation to the most used version of js and an increased compatibility with various devices thanks to browserlists. No stylesheet are available at the moment but in the future it might be useful to know that we can now use also scss

Relevant technical choices

  • 2 script were added in package.json, build-js and start-js and are used to do exactly what is documented here
  • The file webpack.config.js was added with a funtion used to "enqueue" scripts, actually is used as suggested by @felixarntz to bundle fallback.js but any other script could be added in this way:
const ref= addModule( 'myfile.js', 'modules/moduleType/moduleName/' );

and then simply add to module.exports an array with all the needed modules comma separated, like below
module.exports = [first, second, etc]

  • Changed the modules/images/webp-uploads/load.php path since must now point to the minified version inside the dist folder, but I haven't published that one, so if you need it will be a good opportunity for a double check 😉

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

@mxbclang
Copy link
Contributor

mxbclang commented Aug 8, 2022

PR for #467

@mxbclang mxbclang added Needs Review Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release labels Aug 8, 2022
@erikyo
Copy link
Author

erikyo commented Apr 11, 2024

closing because outdated!

@erikyo erikyo closed this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants