Script & Build Process
Linting and Minifying
With the move to blocks, ID has deprecated grunt in favor of running npm script commands:
npm run
:
start
: Compiles the styles and scripts fromsrc
tobuild
folders without minifying for development and troubleshooting. This script will run continuously to recompile during development.build
: Like start, this also compiles styles and scripts, however this command minifies and optimizes for production use. This script runs once and exits when complete.
The build command runs the below sub-commands:clean
: Delete existing language fileswpi18n
: Updates the text domain in php fileswpmakepot
: Builds the language.pot
filei18n
: Runs the above three commandsscripts
: Runs the wp build commandversion
: Updates the version from package.json to variables and constants in the code.
new-id-block
: Pulls in the skeleton of a new block based on the BU block template.new-wp-block
: Pulls in the skeleton of the WordPress default block.format
: Cleans up the code based on the WordPress JavaScript coding standardslint
: The lint command will check your code for errors and formatting corrections. The primarylint
command will run the following sub-commands:css
: Checks sass files based on stylelinthtml
: Checks html filesjs
: Checks JavaScript, based on eslintjs:fix
: Same as above, but will also fix possible formatting errorsmd
: Checks markdown files using markdownlintphp
: Bash script running PHP Code Sniffer and Beautifier on changed php files not committed to the repo.php:all
: Same bash script but checks all php files.pkg
: Linting forpackage.json