{"id":24,"date":"2024-10-03T11:46:35","date_gmt":"2024-10-03T16:46:35","guid":{"rendered":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/?page_id=24"},"modified":"2025-03-06T15:18:12","modified_gmt":"2025-03-06T20:18:12","slug":"script-build-process","status":"publish","type":"page","link":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/handbook\/bu-tools\/node-npm\/script-build-process\/","title":{"rendered":"Script &#038; Build Process"},"content":{"rendered":"\n<h2>Linting and Minifying<\/h2>\n\n\n\n<p>With the move to blocks, ID has deprecated grunt in favor of running npm script commands:<\/p>\n\n\n\n<h3><code>npm run<\/code>:<\/h3>\n\n\n\n<ul><li><code><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-scripts\/#start\">start<\/a><\/code>: Compiles the styles and scripts from <code>src<\/code> to <code>build<\/code> folders without minifying for development and troubleshooting. This script will run continuously to recompile during development. <\/li><li><code>build<\/code>: 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. <br>The build command runs the below sub-commands:<ul><li><code>clean<\/code>: Delete existing language files<\/li><li><code>wpi18n<\/code>: Updates the text domain in php files<\/li><li><code>wpmakepot<\/code>: Builds the language <code>.pot<\/code> file<\/li><li><code>i18n<\/code>: Runs the above three commands<\/li><li><code><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-scripts\/#build\">scripts<\/a><\/code>: Runs the wp build command<\/li><li><code>version<\/code>: Updates the version from package.json to variables and constants in the code.<\/li><\/ul><\/li><li><code>new-id-block<\/code>: Pulls in the skeleton of a new block based on the BU block template.<\/li><li><code>new-wp-block<\/code>: Pulls in the skeleton of the WordPress default block.<\/li><li><code><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-scripts\/#format\">format<\/a><\/code>: Cleans up the code based on the WordPress JavaScript coding standards<\/li><li><code>lint<\/code>: The lint command will check your code for errors and formatting corrections. The primary <code>lint<\/code> command will run the following sub-commands:<ul><li><code><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-scripts\/#lint-style\">css<\/a><\/code>: Checks sass files based on stylelint<\/li><li><code>html<\/code>: Checks html files<\/li><li><code><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-scripts\/#lint-js\">js<\/a><\/code>: Checks JavaScript, based on eslint<\/li><li><code>js:fix<\/code>: Same as above, but will also fix possible formatting errors<\/li><li><code><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-scripts\/#lint-md-docs\">md<\/a><\/code>: Checks markdown files using markdownlint<\/li><li><code>php<\/code>: Bash script running PHP Code Sniffer and Beautifier  on changed php files not committed to the repo.<\/li><li><code>php:all<\/code>: Same bash script but checks all php files.<\/li><li><code><a href=\"https:\/\/developer.wordpress.org\/block-editor\/reference-guides\/packages\/packages-scripts\/#lint-pkg-json\">pkg<\/a><\/code>: Linting for <code>package.json<\/code><\/li><\/ul><\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 from src to build folders without minifying for development and troubleshooting. This script will run continuously to recompile during development. build: Like start, this also compiles styles and [&hellip;]<\/p>\n","protected":false},"author":3670,"featured_media":0,"parent":338,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"status-is-a-reserved-term":[],"assignee":[],"_links":{"self":[{"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/pages\/24"}],"collection":[{"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/users\/3670"}],"replies":[{"embeddable":true,"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":3,"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/pages\/24\/revisions"}],"predecessor-version":[{"id":621,"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/pages\/24\/revisions\/621"}],"up":[{"embeddable":true,"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/pages\/338"}],"wp:attachment":[{"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"status-is-a-reserved-term","embeddable":true,"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/status-is-a-reserved-term?post=24"},{"taxonomy":"assignee","embeddable":true,"href":"https:\/\/id-developer-upgrade-58.cms-devl.bu.edu\/gutenberg\/wp-json\/wp\/v2\/assignee?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}