{"id":62158,"date":"2024-12-02T18:24:32","date_gmt":"2024-12-02T09:24:32","guid":{"rendered":"https:\/\/kinsta.com\/jp\/?p=62158&#038;preview=true&#038;preview_id=62158"},"modified":"2024-12-10T23:30:06","modified_gmt":"2024-12-10T14:30:06","slug":"wp-scripts-development","status":"publish","type":"post","link":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/","title":{"rendered":"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5"},"content":{"rendered":"<p>Web\u5236\u4f5c\u4f1a\u793e\u3084\u4ee3\u884c\u696d\u8005\u306eWordPress\u958b\u767a\u696d\u52d9\u306f\u3001\u5e38\u306b\u7af6\u4e89\u7387\u304c\u9ad8\u3044\u5206\u91ce\u3067\u3059\u3002\u8907\u6570\u306e\u9867\u5ba2\u306b\u5bfe\u3057\u3066\u305d\u308c\u305e\u308c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u62b1\u3048\u3066\u3044\u308b\u5834\u5408\u306b\u306f\u3001\u6700\u5927\u9650\u306e\u52b9\u7387\u6027\u3068\u4e00\u8cab\u6027\u304c\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u958b\u767a\u8005\u3068\u3057\u3066\u3069\u308c\u307b\u3069\u30b9\u30ad\u30eb\u3068\u7d4c\u9a13\u3092\u78e8\u3044\u3066\u3082\u3001\u958b\u767a\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30dd\u30fc\u30c8\u30d5\u30a9\u30ea\u30aa\u5168\u4f53\u3092\u7ba1\u7406\u3059\u308b\u306b\u306f\u3001\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u52b9\u7387\u5316\u3068\u3044\u3046\u70b9\u3067\u7d99\u7d9a\u7684\u306a\u52aa\u529b\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u3053\u3067\u6d3b\u7528\u3057\u305f\u3044\u306e\u304c\u3001<code>wp-scripts<\/code>\u3067\u3059\u3002 <code>wp-scripts<\/code>\u306f\u3001\u5f93\u6765\u306eWordPress\u958b\u767a\u696d\u52d9\u306b\u9769\u547d\u3092\u8d77\u3053\u3059\u958b\u767a\u30c4\u30fc\u30eb\u30ad\u30c3\u30c8\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001<code>wp-scripts<\/code>\u306e\u6a5f\u80fd\u3092\u53d6\u308a\u4e0a\u3052\u3001\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\u30b3\u30f3\u30d1\u30a4\u30eb\u3068\u30d0\u30f3\u30c9\u30eb\u306e\u6700\u9069\u5316\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\uff08\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3084\u4e00\u8cab\u6027\u3092\u78ba\u8a8d\u3057\u3001\u30a8\u30e9\u30fc\u3084\u8b66\u544a\u3092\u7279\u5b9a\u3057\u3066\u4fee\u6b63\u3092\u4fc3\u3059\u30d7\u30ed\u30bb\u30b9\uff09\u3001\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u306a\u3069\u3001\u8907\u6570\u306eWordPress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u62b1\u3048\u308bWeb\u5236\u4f5c\u4f1a\u793e\u306b\u5f79\u7acb\u3064\u6709\u76ca\u306a\u60c5\u5831\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div><\/div><kinsta-auto-toc heading=\"Table of Contents\" exclude=\"last\" list-style=\"arrow\" selector=\"h2\" count-number=\"-1\"><\/kinsta-auto-toc>\n<h2>\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u6982\u5ff5<\/h2>\n<p><code>wp-scripts<\/code>\u306b\u3064\u3044\u3066\u6398\u308a\u4e0b\u3052\u308b\u524d\u306b\u3001\u307e\u305a\u306f\u30a6\u30a7\u30d6\u958b\u767a\u306e\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u3068\u3044\u3046\u3088\u308a\u5e83\u7fa9\u306a\u6982\u5ff5\u3092\u7406\u89e3\u3057\u307e\u3057\u3087\u3046\u3002\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u306f\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u672c\u756a\u74b0\u5883\u3067\u4f7f\u7528\u53ef\u80fd\u306a\u30a2\u30d7\u30ea\u3084\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u306b\u4ed5\u4e0a\u3052\u308b\u305f\u3081\u306e\u3001\u4e00\u9023\u306e\u81ea\u52d5\u5316\u3055\u308c\u305f\u30bf\u30b9\u30af\u3067\u69cb\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u81ea\u52d5\u5316\u306b\u3088\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30bf\u30b9\u30af\u304c\u52b9\u7387\u5316\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6700\u65b0\u306eJavaScript\u3092\u30d6\u30e9\u30a6\u30b6\u4e92\u63db\u306e\u30b3\u30fc\u30c9\u306b\u5909\u63db\uff08\u30b3\u30f3\u30d1\u30a4\u30eb\uff09<\/li>\n<li>CSS\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u8a00\u8a9e\uff08<a href=\"https:\/\/sass-lang.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Sass<\/a>\u306a\u3069\uff09\u3092\u6a19\u6e96CSS\u306b\u5909\u63db\uff08\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb\uff09<\/li>\n<li><a href=\"https:\/\/kinsta.com\/javascript\/\">JavaScript<\/a>\u3001CSS\u3001\u30e1\u30c7\u30a3\u30a2\u306a\u3069\u306e\u30a2\u30bb\u30c3\u30c8\u306e\u6700\u5c0f\u5316\u304a\u3088\u3073\u6700\u9069\u5316<\/li>\n<li>\u30ea\u30f3\u30bf\u30fc\uff08linter\uff09\u3092\u5b9f\u884c\u3057\u3066\u6f5c\u5728\u7684\u306a\u30a8\u30e9\u30fc\u3092\u691c\u51fa\u3057\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u6a19\u6e96\u3092\u9069\u7528<\/li>\n<li>\u3088\u308a\u826f\u3044\u30b3\u30fc\u30c9\u6a5f\u80fd\u3092\u4fdd\u8a3c\u3059\u308b\u305f\u3081\u306e<a href=\"https:\/\/kinsta.com\/jp\/blog\/laravel-unit-testing\/\">\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8<\/a>\u306e\u5b9f\u884c<\/li>\n<\/ul>\n<p>\u4e0a\u8a18\u306f\u3001\u3042\u3089\u3086\u308b<a href=\"https:\/\/kinsta.com\/jp\/blog\/wordpress-workflow\/\">\u958b\u767a\u30ef\u30fc\u30af\u30d5\u30ed\u30fc<\/a>\u306b\u304a\u3044\u3066\u81ea\u52d5\u5316\u3057\u305f\u3044\u30bf\u30b9\u30af\u3067\u3059\u304c\u3001\u8907\u6570\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08\u305d\u3057\u3066\u30c1\u30fc\u30e0\u9593\uff09\u3067\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u3001Web\u5236\u4f5c\u4f1a\u793e\u306b\u3068\u3063\u3066\u306f\u7279\u306b\u91cd\u8981\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u4e00\u8cab\u6027\u3092\u6d3b\u304b\u3057\u3066\u3001\u975e\u5e38\u306b\u8907\u96d1\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3082\u52b9\u7387\u7684\u306a\u30b5\u30a4\u30af\u30eb\u3067\u958b\u767a\u3068\u30c7\u30d7\u30ed\u30a4\u3092\u884c\u3044\u3001\u3059\u3079\u3066\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u7dad\u6301\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316\u306b\u3088\u308a\u3001\u30a8\u30f3\u30c9\u30e6\u30fc\u30b6\u30fc\u306e\u5168\u4f53\u7684\u306a\u30a8\u30af\u30b9\u30da\u30ea\u30a8\u30f3\u30b9\u3082\u6539\u5584\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/community.kinsta.com\/t\/install-node-and-gulp\/2804\" target=\"_blank\" rel=\"noopener noreferrer\">Gulp<\/a>\u3084<a href=\"https:\/\/gruntjs.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Grunt<\/a>\u306e\u3088\u3046\u306a\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u3001\u307e\u305f\u306f\u624b\u52d5\u3067\u72ec\u81ea\u306e\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u3092\u300c\u5bc4\u305b\u96c6\u3081\u308b\u300d\u3068\u3044\u3046\u3001Web\u5236\u4f5c\u4f1a\u793e\u306b\u898b\u3089\u308c\u308b\u4e00\u822c\u7684\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u306f\u3001\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u696d\u52d9\u306e\u8ca0\u62c5\u304c\u81a8\u308c\u4e0a\u304c\u308b\u3053\u3068\u306f\u3082\u3061\u308d\u3093\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u9593\u306e\u4e0d\u6574\u5408\u306b\u3064\u306a\u304c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>WordPress\u958b\u767a\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306b\u9769\u547d\u3092\u8d77\u3053\u3059wp-scripts<\/h2>\n<p>WordPress\u3067\u306f\u3001\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u306f\u30c6\u30fc\u30de\u3068\u30d7\u30e9\u30b0\u30a4\u30f3\u958b\u767a\u3092\u5927\u304d\u304f\u52b9\u7387\u5316\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u6700\u65b0\u306e\u30c4\u30fc\u30eb\u3068\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u4f7f\u7528\u3057\u306a\u304c\u3089\u3001\u540c\u6642\u306b\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u4e92\u63db\u6027\u3092\u78ba\u4fdd\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code>@wordpress\/scripts<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\uff08\u3053\u306e\u8a18\u4e8b\u3067\u306f<code>wp-scripts<\/code>\uff09\u306f\u3001WordPress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u3092\u7c21\u7d20\u5316\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3068\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<figure id=\"attachment_186951\" aria-describedby=\"caption-attachment-186951\" style=\"width: 1200px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-186951 size-full\" src=\"https:\/\/kinsta.com\/wp-content\/uploads\/2024\/10\/wp-scripts.png\" alt=\"\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u305f\u3081\u306ewp-scripts\u306e\u4e00\u90e8\" width=\"1200\" height=\"842\"><figcaption id=\"caption-attachment-186951\" class=\"wp-caption-text\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u305f\u3081\u306ewp-scripts\u306e\u4e00\u90e8<\/figcaption><\/figure>\n<p>\u30d6\u30ed\u30c3\u30af\u30a8\u30c7\u30a3\u30bf\u30fc\u3068\u30b5\u30a4\u30c8\u30a8\u30c7\u30a3\u30bf\u30fc\u306b\u6b20\u304b\u305b\u306a\u3044\u3053\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001Make WordPress Core\u30c1\u30fc\u30e0\u306b\u3088\u3063\u3066\u958b\u767a\u30fb\u4fdd\u5b88\u7ba1\u7406\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30ab\u30b9\u30bf\u30e0\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u958b\u767a\u306b\u3082\u4f7f\u7528\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u5927\u898f\u6a21\u306aWordPress\u958b\u767a\u306b\u53d6\u308a\u7d44\u3080\u5834\u5408\u306f\u3001<code>wp-scripts<\/code>\u304c\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u4e2d\u5fc3\u306b\u306a\u308a\u307e\u3059\u3002<code>wp-scripts<\/code>\u306f\u5358\u306a\u308b\u30d3\u30eb\u30c9\u30c4\u30fc\u30eb\u3067\u306f\u306a\u304f\u3001\u9ad8\u5ea6\u306a\u958b\u767a\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u8981\u4ef6\u306b\u6cbf\u3063\u305f\u3001\u6700\u65b0\u306eWordPress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5411\u3051\u306e\u5305\u62ec\u7684\u306a\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h3>wp-scripts\u306e\u4e3b\u306a\u6a5f\u80fd<\/h3>\n<p>\u30e2\u30c0\u30f3JavaScript\u306e\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u304cWordPress\u306e\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u306b\u6d78\u900f\u3059\u308b\u306b\u3064\u308c\u3001\u305d\u308c\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306e\u6a19\u6e96\u30d3\u30eb\u30c9\u30c4\u30fc\u30eb\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<code>wp-scripts<\/code>\u306e\u5f62\u3067\u7d71\u4e00\u3055\u308c\u305f\u30d3\u30eb\u30c9\u30c4\u30fc\u30eb\u30bb\u30c3\u30c8\u306f\u3001WordPress\u958b\u767a\u306e\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306b\u5229\u76ca\u3092\u3082\u305f\u3089\u3057\u307e\u3059\u3002<\/p>\n<p><code>wp-scripts<\/code>\u306b\u306f\u3001WordPress\u958b\u767a\u3092\u52b9\u7387\u5316\u3059\u308b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>\u8a2d\u5b9a\u4e0d\u8981\u306a\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/strong>\u2500\u8907\u96d1\u306a<a href=\"https:\/\/kinsta.com\/jp\/blog\/vite-vs-webpack\/\">webpack<\/a>\u306e\u8a2d\u5b9a\u306a\u3057\u3067\u4f7f\u3044\u59cb\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<li><strong style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3)\">\u30e2\u30c0\u30f3JavaScript\u306e\u30b5\u30dd\u30fc\u30c8<\/strong><span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">\u2500ES6\u306e\u30b3\u30fc\u30c9\u304c\u30d6\u30e9\u30a6\u30b6\u4e92\u63db\u6027\u306e\u305f\u3081\u306b\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb\u3055\u308c\u3001\u6b63\u78ba\u6027\u304c\u9ad8\u307e\u308b<\/span><\/li>\n<li><strong style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3)\">\u7d44\u307f\u8fbc\u307f\u306eCSS\u51e6\u7406<\/strong>\uff1a<span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">Sass\u306e\u3088\u3046\u306aCSS\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3059\u3050\u306b\u30b5\u30dd\u30fc\u30c8\u3092\u5229\u7528\u3067\u304d\u308b<\/span><\/li>\n<li><strong style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3)\">\u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\u30c4\u30fc\u30eb<\/strong><span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">\uff1a<\/span><a style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\" href=\"https:\/\/kinsta.com\/jp\/blog\/vscode-extensions\/#1-prettier\">ESLint\u3068Prettier<\/a>\u306e<span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">\u4e21\u65b9\u3092\u7d71\u5408\u3057\u3001\u4e00\u8cab\u3057\u305f\u30b3\u30fc\u30c9\u30b9\u30bf\u30a4\u30eb\u3068\u54c1\u8cea\u3092\u5b9f\u73fe<\/span><\/li>\n<li><strong style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3)\">\u30c6\u30b9\u30c8\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3<\/strong>\uff1a<span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">\u30d1\u30c3\u30b1\u30fc\u30b8\u5185\u3067<\/span><a style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\" href=\"https:\/\/kinsta.com\/jp\/blog\/jest\/\">Jest<\/a>\u3092\u4f7f\u7528\u3067\u304d\u308b\u305f\u3081\u3001<span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u3084\u7c21\u5358\u306a\u5b9f\u884c\u304c\u53ef\u80fd<\/span><\/li>\n<li><strong style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3)\">\u30db\u30c3\u30c8\u30ea\u30ed\u30fc\u30c9<\/strong>\uff1a<span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">\u5909\u66f4\u3092\u672c\u756a\u74b0\u5883\u3067\u5373\u5ea7\u306b\u5909\u66f4\u5185\u5bb9\u304c\u53cd\u6620\u3055\u308c\u308b\u3053\u3068\u3067\u958b\u767a\u4f5c\u696d\u304c\u52b9\u7387\u5316\u3055\u308c\u308b<\/span><\/li>\n<\/ul>\n<p><code>wp-scripts<\/code>\u306e\u3053\u306e\u3088\u3046\u306a\u6a5f\u80fd\u7fa4\u306f\u3001\u8907\u6570\u306eWordPress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u7ba1\u7406\u3059\u308bWeb\u5236\u4f5c\u4f1a\u793e\u306b\u3068\u3063\u3066\u5927\u304d\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u3059\u3079\u3066\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u958b\u767a\u74b0\u5883\u3092\u6a19\u6e96\u5316\u3057\u3001\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3082\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u3092\u8907\u88fd\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30d3\u30eb\u30c9\u30c4\u30fc\u30eb\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u4e00\u5143\u5316\u3057\u3001\u66f4\u65b0\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d1\u30c3\u30c1\u306e\u7ba1\u7406\u3082\u7c21\u7d20\u5316\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u5168\u4f53\u3068\u3057\u3066\u306f\u3001\u4e92\u63db\u6027\u306e\u554f\u984c\u306b\u95a2\u3059\u308b\u5fc3\u914d\u304c\u6e1b\u308a\u3001\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u304b\u304b\u308b\u6642\u9593\u304c\u77ed\u7e2e\u3055\u308c\u3001\u9069\u5207\u3067\u306a\u3044\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u3067\u767a\u751f\u3059\u308b\u4e00\u822c\u7684\u306a\u30a8\u30e9\u30fc\u306e\u591a\u304f\u3092\u6392\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>wp-scripts\u3068\u4e00\u822c\u7684\u306aWordPress\u958b\u767a\u30d7\u30ed\u30bb\u30b9\u306e\u6bd4\u8f03<\/h3>\n<p>\u4e00\u822c\u7684\u306aWordPress\u958b\u767a\u3067\u306f\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/wp-enqueue-scripts\/\">\u30b9\u30af\u30ea\u30d7\u30c8\u3084\u30b9\u30bf\u30a4\u30eb\u3092\u624b\u52d5\u3067\u30a8\u30f3\u30ad\u30e5\u30fc<\/a>\u3059\u308b\u3053\u3068\u304c\u591a\u3005\u3042\u308a\u307e\u3059\u3002\u307e\u305f<a href=\"https:\/\/kinsta.com\/jp\/blog\/what-is-javascript\/\">Vanilla JS<\/a>\u3084<a href=\"https:\/\/kinsta.com\/jp\/blog\/what-is-jquery\/\">jQuery<\/a>\u3092\u66f8\u3044\u305f\u308a\u3001\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e\u30d3\u30eb\u30c9\u30c4\u30fc\u30eb\u306b\u983c\u3063\u305f\u308a\u3001\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u304c\u5168\u304f\u306a\u3044\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>wp-scripts\u306f\u5bfe\u7167\u7684\u306b\u3001\u307b\u3068\u3093\u3069\u3059\u3079\u3066\u306e\u9818\u57df\u306b\u304a\u3044\u3066\u3001\u6700\u65b0\u306e\u7d71\u5408\u3055\u308c\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><strong>\u4e00\u822c\u7684\u306a\u958b\u767a<\/strong><\/td>\n<td><strong>wp-scripts<\/strong><\/td>\n<\/tr>\n<tr>\n<td>JavaScript<\/td>\n<td>\u901a\u5e38\u306fVanilla JS\u307e\u305f\u306fjQuery<\/td>\n<td>ES6\u3068React<\/td>\n<\/tr>\n<tr>\n<td>CSS<\/td>\n<td>\u76f4\u63a5CSS\u3092\u66f8\u304f\u304b\u57fa\u672c\u7684\u306a\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5<\/td>\n<td>Sass\u3068PostCSS\u51e6\u7406<\/td>\n<\/tr>\n<tr>\n<td>\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9<\/td>\n<td>Gulp\u307e\u305f\u306fGrunt\u3092\u4f7f\u7528\u3057\u305f\u624b\u52d5\u307e\u305f\u306f\u72ec\u81ea\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/td>\n<td>\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u7d71\u5408\u3055\u308c\u305fwebpack\u3092\u4f7f\u7528\u3057\u8a2d\u5b9a\u4e0d\u8981<\/td>\n<\/tr>\n<tr>\n<td>\u30b3\u30fc\u30c9\u54c1\u8cea<\/td>\n<td>\u624b\u4f5c\u696d\u306b\u3088\u308b\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u307e\u305f\u306f\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u30fc\u306b\u7d71\u5408\u3055\u308c\u305f\u5225\u306e\u30c4\u30fc\u30eb<\/td>\n<td>\u7d44\u307f\u8fbc\u307f\u306eESLint\u3068Prettier<\/td>\n<\/tr>\n<tr>\n<td>\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8<\/td>\n<td>\u901a\u5e38\u306f\u5225\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\uff08\u7121\u8996\u3055\u308c\u306a\u3051\u308c\u3070\uff09<\/td>\n<td>\u7d44\u307f\u8fbc\u307f\u306eJest\u30c6\u30b9\u30c8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><code>wp-scripts<\/code>\u306f\u7570\u306a\u308b\u30c4\u30fc\u30eb\u3068\u306e\u7d71\u5408\u306b\u3088\u308a\u3001\u5168\u4f53\u3068\u3057\u3066\u3088\u308a\u67d4\u8edf\u6027\u306b\u512a\u308c\u3066\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001<a href=\"https:\/\/postcss.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">PostCSS<\/a>\u3001<a href=\"https:\/\/webpack.js.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">webpack<\/a>\u3001<a href=\"https:\/\/jestjs.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">Jest<\/a>\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u624b\u9593\u306f\u7701\u7565\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>wp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u958b\u767a\u74b0\u5883\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5<\/h2>\n<p><code>wp-scripts<\/code>\u3092\u4f7f\u3046\u306b\u306f\u305d\u308c\u306a\u308a\u306e\u8981\u4ef6\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3059\u3067\u306b\u4f7f\u7528\u3057\u3066\u3044\u308b\u5fc5\u8981\u30c4\u30fc\u30eb\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/how-to-install-node-js\/\">Node.js\u3068npm<\/a>\u3092\u30ed\u30fc\u30ab\u30eb\u306eWordPress\u958b\u767a\u74b0\u5883\u3068\u3068\u3082\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<a href=\"https:\/\/kinsta.com\/jp\/devkinsta\/\">DevKinsta<\/a>\u306f<a href=\"https:\/\/kinsta.com\/jp\/blog\/what-is-docker\/\">Docker<\/a>\u4e0a\u3067\u52d5\u4f5c\u3057\u3001Kinsta\u306e\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u74b0\u5883\u3068\u4e92\u63db\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u304a\u3059\u3059\u3081\u306e\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<figure id=\"attachment_61232\" aria-describedby=\"caption-attachment-61232\" style=\"width: 1193px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-61232 size-full\" src=\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2022\/09\/devkinsta-main-screen.png\" alt=\"DevKinsta\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\" width=\"1193\" height=\"849\" srcset=\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2022\/09\/devkinsta-main-screen.png 1193w, https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2022\/09\/devkinsta-main-screen-300x213.png 300w, https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2022\/09\/devkinsta-main-screen-1024x729.png 1024w, https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2022\/09\/devkinsta-main-screen-768x547.png 768w\" sizes=\"auto, (max-width: 1193px) 100vw, 1193px\" \/><figcaption id=\"caption-attachment-61232\" class=\"wp-caption-text\">DevKinsta\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9<\/figcaption><\/figure>\n<p><a href=\"https:\/\/kinsta.com\/jp\/blog\/gutenberg-blocks\/\">WordPress\u30d6\u30ed\u30c3\u30af\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u958b\u767a<\/a>\u306b\u3059\u3067\u306b<code>create-block<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001<code>wp-scripts<\/code>\u3092\u4ed6\u306e\u30a2\u30bb\u30c3\u30c8\u3068\u4e00\u7dd2\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u958b\u59cb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>wp-scripts\u3067WordPress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u7acb\u3061\u4e0a\u3052\u308b<\/h3>\n<p>WordPress\u306e<strong>wp-content<\/strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u3067\u4f5c\u696d\u3092\u884c\u3044\u307e\u3059\u3002\u30b5\u30d6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u3001\u4f5c\u6210\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3002\u30c6\u30fc\u30de\u306e\u5834\u5408\u306f<strong>wp-content\/themes<\/strong>\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u5834\u5408\u306f<strong>wp-content\/plugins<\/strong>\u3067\u3059\u3002<\/p>\n<p>\u3044\u305a\u308c\u306b\u3057\u3066\u3082\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u306b\u306f\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li><code>package.json<\/code> \u30d5\u30a1\u30a4\u30eb<\/li>\n<li><strong style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3)\">build<\/strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/li>\n<li><code style=\"font-weight: var(--kmt-sys-typography-body-font-weight)\">index.js<\/code><span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">\u30d5\u30a1\u30a4\u30eb\u3092\u542b\u3080<\/span><strong style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3)\">src<\/strong><span style=\"background-color: var(--kmt-sys-color-background-neutral-weak, #f9f5f3);font-weight: var(--kmt-sys-typography-body-font-weight)\">\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/span><\/li>\n<\/ul>\n<p><code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u307e\u305f\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a2\u30d7\u30ea\u3092\u4f7f\u7528\u3057\u3066\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<code>npm init<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5bfe\u8a71\u578b\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u30d7\u30ed\u30bb\u30b9\u304c\u884c\u308f\u308c\u3001\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u306f<code>build\/index.js<\/code>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<figure id=\"attachment_186953\" aria-describedby=\"caption-attachment-186953\" style=\"width: 1200px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-186953 size-full\" src=\"https:\/\/kinsta.com\/wp-content\/uploads\/2024\/10\/npm-init.png\" alt=\"npm init\u30d7\u30ed\u30bb\u30b9\u306e\u4e00\u90e8\u3092\u5b9f\u884c\u3057\u3001\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u306e\u5024\u3092\u5165\u529b\u3059\u308b\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u8868\u793a\" width=\"1200\" height=\"420\"><figcaption id=\"caption-attachment-186953\" class=\"wp-caption-text\">npm init\u30d7\u30ed\u30bb\u30b9\u306e\u4e00\u90e8\u3092\u5b9f\u884c\u3057\u3001\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u306e\u5024\u3092\u5165\u529b\u3059\u308b\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u8868\u793a<\/figcaption><\/figure>\n<p>\u7d9a\u3044\u3066\u3001<code>wp-scripts<\/code>\u3092\u958b\u767a\u4f9d\u5b58\u3068\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm install @wordpress\/scripts --save-dev\n<\/code><\/pre>\n<p>\u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30d5\u30a1\u30a4\u30eb\u3001<strong>node_modules<\/strong>\u3068<code>package-lock.json<\/code>\u3082\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u3044\u305a\u308c\u306b\u3057\u3066\u3082\u3001<code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u5b9a\u7fa9\u6e08\u307f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u53c2\u7167\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-json\">\"scripts\": {\n  \"build\": \"wp-scripts build\",\n  \"start\": \"wp-scripts start\",\n}\n<\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u983b\u7e41\u306b\u53c2\u7167\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-json\">\u2026\n\n\"lint:js\": \"wp-scripts lint-js\",\n\"lint:css\": \"wp-scripts lint-style\",\n\"lint:pkg-json\": \"wp-scripts lint-pkg-json\",\n\"test\": \"wp-scripts test-unit-js\"\n\u2026\n<\/code><\/pre>\n<p>\u307e\u305f\u3001\u3053\u3053\u3067<a href=\"https:\/\/developer.wordpress.org\/block-editor\/how-to-guides\/enqueueing-assets-in-the-editor\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a2\u30bb\u30c3\u30c8\u3092\u30a8\u30f3\u30ad\u30e5\u30fc<\/a>\u3057\u3001\u5909\u66f4\u3092\u4fdd\u5b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h3>wp-scripts\u3067webpack\u3092\u4f7f\u7528\u3059\u308b<\/h3>\n<p><code>wp-scripts<\/code>\u306f\u3001\u88cf\u3067\u30a2\u30bb\u30c3\u30c8\u3092\u30d0\u30f3\u30c9\u30eb\u3059\u308b\u305f\u3081\u306bwebpack\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u3092\u81ea\u5206\u3067\u884c\u3046\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u305d\u306e\u5f79\u5272\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001<code>wp-scripts<\/code>\u3092\u3088\u308a\u52b9\u679c\u7684\u306b\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002webpack\u306f\u3001\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u304a\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>JavaScript\u30e2\u30b8\u30e5\u30fc\u30eb\u9593\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u89e3\u6c7a<\/li>\n<li>\u30e2\u30c0\u30f3JavaScript\u3092\u30d6\u30e9\u30a6\u30b6\u4e92\u63db\u306e\u30b3\u30fc\u30c9\u306b\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb<\/li>\n<li>\u30b9\u30bf\u30a4\u30eb\u306e\u51e6\u7406\u3068\u6700\u9069\u5316<\/li>\n<li>\u30bd\u30fc\u30b9\u30de\u30c3\u30d7\u3092\u751f\u6210\u3057\u3066\u30c7\u30d0\u30c3\u30b0\u3092\u7c21\u7d20\u5316<\/li>\n<li>\u672c\u756a\u74b0\u5883\u3067\u3059\u3050\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u6700\u5c0f\u5316\u3055\u308c\u305f\u30d0\u30f3\u30c9\u30eb\u3092\u4f5c\u6210<\/li>\n<\/ul>\n<p><code>wp-scripts<\/code>\u5185\u306b\u3059\u3067\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306ewebpack\u8a2d\u5b9a\u304c\u3042\u308a\u3001\u307b\u307c\u3059\u3079\u3066\u306eWordPress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3046\u307e\u304f\u6a5f\u80fd\u3057\u307e\u3059\u304c\u3001\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u30ab\u30b9\u30bf\u30e0\u8a2d\u5b9a\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h3>Web\u5236\u4f5c\u4f1a\u793e\u5411\u3051\u306e\u9ad8\u5ea6\u306awebpack\u8a2d\u5b9a<\/h3>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306ewebpack\u8a2d\u5b9a\u306f\u3001\u5927\u4f53\u306e\u958b\u767a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u9069\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u8907\u96d1\u306a\u30c6\u30fc\u30de\u69cb\u9020\u3084\u72ec\u81ea\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3092\u6271\u3046\u969b\u306a\u3069\u3001\u7279\u5b9a\u306e\u8981\u4ef6\u306b\u5fdc\u3058\u3066\u8a2d\u5b9a\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30eb\u30fc\u30c8\u306b\u3042\u308b<code>webpack.config.js<\/code> \u30d5\u30a1\u30a4\u30eb\u304c\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-js\">const defaultConfig = require(\"@wordpress\/scripts\/config\/webpack.config\");\n\nconst path = require('path');\n\n\nmodule.exports = {\n  ...defaultConfig,\n  entry: {\n    main: path.resolve(__dirname, 'src\/js\/main.js'),\n    admin: path.resolve(__dirname, 'src\/js\/admin.js'),\n    \/\/ \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3092\u8ffd\u52a0\n  },\n  output: {\n    filename: '[name].js',\n    path: path.resolve(__dirname, 'dist'),\n  },\n  \/\/ \u3053\u3053\u306b\u30ab\u30b9\u30bf\u30e0\u30ed\u30fc\u30c0\u30fc\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8ffd\u52a0\n};\n<\/code><\/pre>\n<p>\u3053\u306e\u8a2d\u5b9a\u306f\u3001\u8907\u6570\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3092\u53ef\u80fd\u306b\u3057\u3001WordPress\u306e\u7ba1\u7406\u753b\u9762\u3084\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u7570\u306a\u308b\u90e8\u5206\u306b\u5225\u3005\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5fc5\u8981\u3068\u3059\u308b\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u7279\u306b\u6709\u7528\u3067\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u3092\u62e1\u5f35\u3057\u3066\u3001<code>wp-scripts<\/code>\u306e\u5229\u70b9\u3092\u6d3b\u304b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>wp-scripts\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n<p>\u9069\u5207\u306a\u958b\u767a\u74b0\u5883\u3001\u30d5\u30a1\u30a4\u30eb\u304a\u3088\u3073\u30d5\u30a9\u30eb\u30c0\u69cb\u9020\u304c\u3042\u308c\u3070\u3001<code>wp-scripts<\/code>\u3092\u4f7f\u3044\u59cb\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u983b\u7e41\u306b\u4f7f\u3046\u3053\u3068\u306b\u306a\u308b\u57fa\u672c\u7684\u306a\u30b3\u30a2\u30b3\u30de\u30f3\u30c9\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><code>start<\/code>\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u3092\u76e3\u8996\u3057\u3001\u305d\u306e\u5834\u3067\u30a2\u30bb\u30c3\u30c8\u3092\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3001\u958b\u767a\u3092\u52b9\u7387\u5316\u3059\u308b\u30db\u30c3\u30c8\u30ea\u30ed\u30fc\u30c9\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm run start\n<\/code><\/pre>\n<p><strong>build\/index.js<\/strong>\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u305f\u30b3\u30fc\u30c9\u3092\u6700\u9069\u5316\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u958b\u767a\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3059\u308b\u305f\u3081\u306b\u6700\u521d\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001<code>build<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u672c\u756a\u3088\u3046\u306b\u30a2\u30bb\u30c3\u30c8\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm run build\n<\/code><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001JavaScript\u306e\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb\u3001Sass\u3068SCSS\u3092CSS\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30a2\u30bb\u30c3\u30c8\u306e\u6700\u5c0f\u5316\u3001<a href=\"https:\/\/web.dev\/articles\/source-maps\" target=\"_blank\" rel=\"noopener noreferrer\">\u30bd\u30fc\u30b9\u30de\u30c3\u30d7<\/a>\u306e\u751f\u6210\u306a\u3069\u306e\u30bf\u30b9\u30af\u304c\u51e6\u7406\u3055\u308c\u307e\u3059\u3002\u6700\u5f8c\u306b\u3001\u3059\u3079\u3066\u304c<code>build\/index.js<\/code>\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u529b\u3055\u308c\u3001\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u3067\u306f\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u30d0\u30b9\u30c8\u7528\u306b<code>build\/index.asset.php<\/code>\u30d5\u30a1\u30a4\u30eb\u3082\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><code>wp-scripts<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f\u3001\u9ad8\u3044\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u7dad\u6301\u3059\u308b\u305f\u3081\u306elint\u30b3\u30de\u30f3\u30c9\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><code>npm run lint:js<\/code>\uff1aJavaScript\u30d5\u30a1\u30a4\u30eb\u306e\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0<\/li>\n<li><code>npm run lint:css<\/code>\uff1aCSS\u3084Sass\u30d5\u30a1\u30a4\u30eb\u306e\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0<\/li>\n<li><code>npm run lint:pkg-json<\/code>\uff1a<code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u8a3c<\/li>\n<\/ul>\n<p>\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u306e\u5834\u5408\u306f\u3001<code>npm run test<\/code>\u3092\u547c\u3073\u51fa\u3059\u3060\u3051\u3067Jest\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>wp-scripts\u306e\u30b3\u30a2\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3<\/h2>\n<p>\u57fa\u672c\u7684\u306a\u30d3\u30eb\u30c9\u30bf\u30b9\u30af\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u3001\u4e00\u822c\u7684\u306a\u30b3\u30de\u30f3\u30c9\u306b\u306f\u591a\u304f\u306e\u81ea\u52d5\u5316\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u304c\u3001<code>wp-scripts<\/code>\u306b\u306f\u3001WordPress\u958b\u767a\u306e\u8907\u96d1\u306a\u8981\u4ef6\u3092\u6e80\u305f\u3059\u9ad8\u5ea6\u306a\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>\u9ad8\u5ea6\u306a\u30b3\u30f3\u30d1\u30a4\u30eb<\/strong>\u2500\u8a2d\u5b9a\u304c\u6700\u9069\u5316\u3055\u308c\u3066\u304a\u308a\u3001ECMAScript Modules\uff08ESM\uff09\u3084 Javascript XML\uff08JSX\uff09\u3092\u542b\u3080\u6700\u65b0\u306eJavaScript\u306e\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb\u3001Sass\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u53ef\u80fd<\/li>\n<li><strong>\u9ad8\u5ea6\u306a\u30d0\u30f3\u30c9\u30eb<\/strong>\u2500webpack\u306e\u30b3\u30fc\u30c9\u5206\u5272\u3068<a href=\"https:\/\/webpack.js.org\/guides\/tree-shaking\/\" target=\"_blank\" rel=\"noopener noreferrer\">Tree shaking<\/a>\u3092\u6d3b\u7528\u3057\u3066\u3001\u30a2\u30bb\u30c3\u30c8\u306e\u914d\u5e03\u3092\u6700\u9069\u5316\u3067\u304d\u308b<\/li>\n<li><strong>\u5305\u62ec\u7684\u306a\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0<\/strong>\u2500JavaScript\u3001CSS\u3001<code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u5168\u4f53\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u6a19\u6e96\u3092\u9069\u7528\u3067\u304d\u308b<\/li>\n<li><strong>\u7d71\u5408\u30c6\u30b9\u30c8<\/strong>\u2500Jest\u3092\u4f7f\u7528\u3057\u3066\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u3068\u30ab\u30d0\u30ec\u30c3\u30b8\u30ec\u30dd\u30fc\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b<\/li>\n<li><strong>\u958b\u767a\u30b5\u30fc\u30d0\u30fc<\/strong>\u2500\u30db\u30c3\u30c8\u30ea\u30ed\u30fc\u30c9\u3067\u8907\u6570\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u307e\u305f\u304c\u308b\u958b\u767a\u304c\u52b9\u7387\u5316\u3055\u308c\u308b<\/li>\n<\/ul>\n<p>\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u95a2\u4fc2\u306a\u304f\u3001\u305d\u308c\u305e\u308c\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u6a5f\u80fd\u3092\u62e1\u5f35\u3057\u3066\u3001\u3088\u308a\u67d4\u8edf\u306aWordPress\u958b\u767a\u30d7\u30ed\u30bb\u30b9\u3092\u78ba\u7acb\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>JSX\u3068\u30e2\u30c0\u30f3JavaScript\u306e\u6271\u3044\u65b9<\/h3>\n<p>\u591a\u304f\u306eWordPress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/best-react-tutorials\/\">React\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/a>\u3001\u30a2\u30ed\u30fc\u95a2\u6570\u3001\u5206\u5272\u4ee3\u5165\uff08\u30c7\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u30ea\u30f3\u30b0\uff09\u3001<code>async<\/code>\/<code>await<\/code>\u306a\u3069\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/javascript-react\/\">\u30e2\u30c0\u30f3JavaScript\u8981\u7d20<\/a>\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u30d6\u30ed\u30c3\u30af\u30a8\u30c7\u30a3\u30bf\u30fc\u306e\u3088\u3046\u306a\u30b3\u30a2\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u306e\u5074\u9762\u3082\u30e2\u30c0\u30f3JavaScript\u306b\u3088\u3063\u3066\u69cb\u7bc9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u30d6\u30e9\u30a6\u30b6\u306f\u3053\u308c\u3089\u306e\u9ad8\u5ea6\u306a\u69cb\u6587\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb\u3084\u30b3\u30f3\u30d1\u30a4\u30eb\u306b\u306f\u3088\u308a\u591a\u304f\u306e\u4f5c\u696d\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/kinsta.com\/jp\/blog\/what-is-jsx\/\">JSX<\/a>\u3092\u4f7f\u3048\u3070\u3001JavaScript\u306e\u4e2d\u306bHTML\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3084\u305d\u306e\u4ed6\u306e\u8981\u7d20\u304c\u3069\u306e\u3088\u3046\u306b\u898b\u3048\u308b\u3079\u304d\u304b\u3092\u7c21\u5358\u306b\u66f8\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u53ef\u8aad\u6027\u3068\u4fdd\u5b88\u6027\u304c\u5411\u4e0a\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u52d5\u7684\u306a\u30e6\u30fc\u30b6\u30fc\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\uff08UI\uff09\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u5f37\u529b\u306aReact\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code>wp-scripts<\/code>\u306f\u3001JavaScript\u30c8\u30e9\u30f3\u30b9\u30b3\u30f3\u30d1\u30a4\u30e9\u3067\u3042\u308b<a href=\"https:\/\/babeljs.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">Babel<\/a>\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e2\u30c0\u30f3JavaScript\u3068JSX\u3092\u30d6\u30e9\u30a6\u30b6\u304c\u7406\u89e3\u3067\u304d\u308b\u30b3\u30fc\u30c9\u306b\u5909\u63db\u3057\u307e\u3059\u3002\u8907\u96d1\u3067\u5fc5\u8981\u306a\u8a2d\u5b9a\u3092\u3059\u3079\u3066\u51e6\u7406\u3057\u3066\u304f\u308c\u308b\u305f\u3081\u3001\u30b3\u30fc\u30c9\u306e\u8a18\u8ff0\u306b\u5c02\u5ff5\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f<code>src\/index.js <\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u901a\u3057\u3066\u6d3b\u7528\u3057\u307e\u3059\u3002<code>wp-scripts<\/code>\u3092\u4f7f\u3063\u3066JSX\u3068\u30e2\u30c0\u30f3JavaScript\u3092\u5b9f\u88c5\u3059\u308b\u7c21\u5358\u306a\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code class=\"language-js\">import { render } from '@wordpress\/element';\n\n\/\/ JavaScript\u306e\u6700\u65b0\u6a5f\u80fd\uff1a \u30a2\u30ed\u30fc\u95a2\u6570\nconst HelloWorld = () =&gt; {\n    \/\/ JavaScript\u306e\u6700\u65b0\u6a5f\u80fd\uff1a \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\n    const greeting = `Hello, ${wp.data.select('core\/editor').getCurrentPost().title}!`;    \n\n    \/\/ JSX\n    return (\n        &lt;div className=\"hello-world\"&gt;\n            &lt;h1&gt;{greeting}&lt;\/h1&gt;\n            &lt;p&gt;\u3053\u308c\u306fWordPress\u306eReact\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3059&lt;\/p&gt;\n        &lt;\/div&gt;\n    );\n};\n\n\/\/ JavaScript\u306e\u6700\u65b0\u6a5f\u80fd\uff1a \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u9023\u9396\nconst rootElement = document.getElementById('hello-world-root');\nif (rootElement?.innerHTML) {\n    render(&lt;HelloWorld \/&gt;, rootElement);\n}\n<\/code><\/pre>\n<p>\u307e\u305f\u3001\u30c6\u30fc\u30de\u306e<strong>functions.php<\/strong>\u30d5\u30a1\u30a4\u30eb\u5185\u3001\u307e\u305f\u306f\u30e1\u30a4\u30f3\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30a8\u30f3\u30ad\u30e5\u30fc\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">function enqueue_hello_world_script() {\n    wp_enqueue_script(\n        'hello-world-script',\n        get_template_directory_uri() . '\/build\/index.js',\n        ['wp-element'],\n        filemtime(get_template_directory() . '\/build\/index.js'),\n        true\n    );\n}\n\nadd_action('wp_enqueue_scripts', 'enqueue_hello_world_script');<\/code><\/pre>\n<p><code>npx wp-scripts build<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<code>wp-scripts<\/code>\u306f\u30e2\u30c0\u30f3JavaScript\u3068JSX\u3092\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb\u3057\u3001\u30d6\u30e9\u30a6\u30b6\u3068\u4e92\u63db\u6027\u306e\u3042\u308b<code>build\/index.js<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30b3\u30fc\u30c9\u54c1\u8cea\u30c1\u30a7\u30c3\u30af\u3068\u6d17\u7df4\u3055\u308c\u305f\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0<\/h3>\n<p><code>wp-scripts<\/code>\u3067\u306f\u8cea\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u7dad\u6301\u3057\u306a\u304c\u3089\u3001ESLint\u3084Prettier\u3001\u3055\u3089\u306bCSS\u3068SCSS\u306e\u30ea\u30f3\u30c8\uff08\u30b3\u30fc\u30c9\u306e\u691c\u67fb\uff09\u306b<strong>stylelint<\/strong>\u3092\u5229\u7528\u3057\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u3067\u4e00\u8cab\u3057\u305f\u30b9\u30bf\u30a4\u30eb\u3092\u4fdd\u3064\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001<code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u306blinting\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-json\">\"scripts\": {\n  \"lint:js\": \"wp-scripts lint-js\",\n  \"lint:css\": \"wp-scripts lint-style\",\n  \"lint\": \"npm run lint:js && npm run lint:css\"\n}\n<\/code><\/pre>\n<p>\u7d9a\u3044\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30ab\u30b9\u30bf\u30e0\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001ESLint\u3067\u306f<code>.eslintrc.js<\/code>\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u3067\u4f5c\u696d\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u4eca\u56de\u306e\u4f8b\u3067\u306f\uff08\u90e8\u5206\u7684\u306b\uff09JavaScript\u30b3\u30fc\u30c9\u306e\u6587\u5b57\u5217\u306b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u5f37\u5236\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">\u2026\nmodule.exports = {\n  extends: [\n    'plugin:@wordpress\/eslint-plugin\/recommended',\n  ],\n  rules: {\n    \/\/ \u3053\u3053\u306b\u30ab\u30b9\u30bf\u30e0\u30eb\u30fc\u30eb\n    'no-console': 'error',\n    'react-hooks\/exhaustive-deps': 'warn',\n    'prefer-template': 'error',\n  },\n};\n\u2026\n<\/code><\/pre>\n<p>stylelint\u3067\u306f\u3001<code>.stylelintrc.js<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">\u2026\nmodule.exports = {\n  extends: [\n    '@wordpress\/stylelint-config\/scss',\n  ],\n  rules: {\n    \/\/ \u3053\u3053\u306b\u30ab\u30b9\u30bf\u30e0\u30eb\u30fc\u30eb\n    'selector-class-pattern': '^[a-z]+(-[a-z]+)*$',\n    'max-nesting-depth': 3,\n  },\n};\n\u2026\n<\/code><\/pre>\n<p>\u8907\u6570\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u307e\u305f\u304c\u308b\u5927\u898f\u6a21\u306a\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u3092\u7ba1\u7406\u3059\u308b\u5834\u5408\u3001\u4e00\u8cab\u3057\u305f\u30b3\u30fc\u30c9\u30b9\u30bf\u30a4\u30eb\u306e\u78ba\u4fdd\u306f\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002\u3053\u306e\u65b9\u6cd5\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306eESLint\u3068stylelint\u306e\u8a2d\u5b9a\u3092\u62e1\u5f35\u3057\u3066\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u6a19\u6e96\u306b\u5f93\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u304b\u3089<code>npm run lint<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u7279\u5b9a\u306elint\u30bf\u30a4\u30d7\u3092\u62e1\u5f35\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u57fa\u672c\u7684\u306a\u9023\u7d50\u3092\u8a18\u8ff0\u3057\u305f\u30b3\u30fc\u30c9\u304c\u3042\u308b\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">const name = \"World\";\nconsole.log(\"Hello \" + name + \"!\");\n<\/code><\/pre>\n<p><code>npm run lint:js<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u3001\u4ee3\u308f\u308a\u306b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u4fc3\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">const name = \"World\";\nconsole.log(`Hello ${name}!`);\n<\/code><\/pre>\n<p>\u3053\u308c\u306f\u3001WordPress\u306e\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30b3\u30fc\u30c9\u3092\u30ea\u30f3\u30c8\u3059\u308b\u306e\u306b\u975e\u5e38\u306b\u5f79\u7acb\u3061\u3001\u7279\u5b9a\u306e\u8981\u4ef6\u3084\u6a19\u6e96\u306b\u5408\u308f\u305b\u3066\u30eb\u30fc\u30eb\u30bb\u30c3\u30c8\u3092\u8abf\u6574\u3059\u308b\u4f59\u5730\u3092\u4e0e\u3048\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<h3>\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8<\/h3>\n<p>\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u306f\u3001\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u306e\u4fe1\u983c\u6027\u3068\u4fdd\u5b88\u6027\u3092\u78ba\u4fdd\u3059\u308b\u306e\u306b\u6b20\u304b\u305b\u307e\u305b\u3093\u3002<code>wp-scripts<\/code>\u306f\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u3057\u3066Jest\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><code>test<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001Jest\u306f<code>.test.js<\/code>\u307e\u305f\u306f<code>.spec.js<\/code>\u306e\u62e1\u5f35\u5b50\u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u3001\u3042\u308b\u3044\u306f<strong>__tests__<\/strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u63a2\u3057\u3001\u3053\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3057\u3066\u7d50\u679c\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001<code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u30c6\u30b9\u30c8\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u53c2\u7167\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">\u2026\n\"scripts\": {\n  \"test\": \"wp-scripts test-unit-js\"\n}\n\u2026\n<\/code><\/pre>\n<p>\u5fc5\u8981\u3067\u3042\u308c\u3070\u3001<code>src\/utils.js<\/code>\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code class=\"language-js\">\u2026\nexport function capitalizeString(str) {\n  return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\nexport function sum(a, b) {\n  return a + b;\n}\n\u2026\n<\/code><\/pre>\n<p>\u3053\u3053\u304b\u3089\u3001<code>src\/__tests__\/utils.test.js<\/code>\u306e\u3088\u3046\u306a\u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">import { capitalizeString, sum } from '..\/utils';\n\ndescribe('capitalizeString', () =&gt; {\n  it('\u6587\u5b57\u5217\u306e\u6700\u521d\u306e\u6587\u5b57\u3092\u5927\u6587\u5b57\u306b\u3059\u308b', () =&gt; {\n    expect(capitalizeString('hello')).toBe('Hello');\n  });\n  it('\u7a7a\u306e\u6587\u5b57\u5217\u304c\u4e0e\u3048\u3089\u308c\u305f\u5834\u5408\u3001\u7a7a\u306e\u6587\u5b57\u5217\u3092\u8fd4\u3059', () =&gt; {\n    expect(capitalizeString('')).toBe('');\n  });\n});\n\ndescribe('sum', () =&gt; {\n  it('2\u3064\u306e\u6570\u5b57\u3092\u6b63\u3057\u304f\u8db3\u3059', () =&gt; {\n    expect(sum(2, 3)).toBe(5);\n  });\n  it('\u8ca0\u306e\u6570\u3092\u6271\u3046', () =&gt; {\n    expect(sum(-1, 1)).toBe(0);\n  });\n});\n<\/code><\/pre>\n<p><code>npm run test<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<code>wp-scripts<\/code>\u306f\u81ea\u52d5\u7684\u306b<strong>.test.js<\/strong>\u3068\u3044\u3046\u62e1\u5f35\u5b50\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u3059\u3079\u3066\u7279\u5b9a\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u30c6\u30b9\u30c8\u30ab\u30d0\u30ec\u30c3\u30b8\u306e\u3088\u3046\u306a\u9ad8\u5ea6\u306a\u30c6\u30b9\u30c8\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u305f\u3081\u306b\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306eJest\u8a2d\u5b9a\u3092\u62e1\u5f35\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-js\">\/\/ jest.config.js\nconst defaultConfig = require('@wordpress\/scripts\/config\/jest-unit.config');\nmodule.exports = {\n  ...defaultConfig,\n  setupFilesAfterEnv: ['&lt;rootDir&gt;\/tests\/setupTests.js'],\n  collectCoverageFrom: [\n    'src\/**\/*.js',\n    '!src\/tests\/**\/*.js',\n    '!src\/vendor\/**\/*.js',\n  ],\n  coverageThreshold: {\n    global: {\n      branches: 80,\n      functions: 80,\n      lines: 80,\n      statements: 80,\n    },\n  },\n};\n<\/code><\/pre>\n<p>\u3053\u306e\u8a2d\u5b9a\u306f\u3001\u30ab\u30b9\u30bf\u30e0\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3057\u3066\u3001\u30ab\u30d0\u30ec\u30c3\u30b8\u30ec\u30dd\u30fc\u30c8\u306b\u542b\u3081\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u3057\u304d\u3044\u5024\u3092\u8a2d\u5b9a\u3057\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u3067\u5305\u62ec\u7684\u306a\u30c6\u30b9\u30c8\u30ab\u30d0\u30ec\u30c3\u30b8\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001Jest\u304c\u6210\u529f\u3057\u305f\u30c6\u30b9\u30c8\u3068\u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u3092\u793a\u3059\u51fa\u529b\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u306e\u6a5f\u80fd\u3092\u62e1\u5f35\u3059\u308b\u3053\u3068\u3067\u3001WordPress\u306e\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u54c1\u8cea\u3068\u4fe1\u983c\u6027\u3092\u5927\u5e45\u306b\u6539\u5584\u3057\u3001\u958b\u767a\u30d7\u30ed\u30bb\u30b9\u5168\u4f53\u3092\u52b9\u7387\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>wp-scripts\u3092\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306b\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5<\/h2>\n<p><code>wp-scripts<\/code>\u306f\u7528\u9014\u306b\u5fdc\u3058\u3066\u597d\u304d\u306a\u3060\u3051\u62e1\u5f35\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u3001<code>wp-scripts<\/code>\u3092\u4f7f\u3063\u3066\u4e00\u822c\u7684\u306a\u30bf\u30b9\u30af\u3092\u81ea\u52d5\u5316\u3059\u308b\u65b9\u6cd5\u3092\u3044\u304f\u3064\u304b\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h3>\u518d\u5229\u7528\u53ef\u80fd\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u4f5c\u6210<\/h3>\n<p>\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u983b\u7e41\u306b\u7acb\u3061\u4e0a\u3052\u308b\u5834\u5408\u3001<code>wp-scripts<\/code>\u3092\u3042\u3089\u304b\u3058\u3081\u8a2d\u5b9a\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u30ab\u30b9\u30bf\u30e0\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3067\u304d\u3001\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u5927\u5e45\u306b\u77ed\u7e2e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code>wp-scripts<\/code>\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u542b\u3080WordPress\u30c6\u30fc\u30de\u307e\u305f\u306f\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3044\u3046\u57fa\u672c\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304b\u3089\u59cb\u3081\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">mkdir my-agency-base-theme\ncd my-agency-base-theme\nnpm init -y\nnpm install --save-dev @wordpress\/scripts\n<\/code><\/pre>\n<p>\u6b21\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020\u3092\u8a2d\u5b9a\u3057\u3066\u3001\u5fc5\u8981\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">mkdir src build\ntouch src\/index.js src\/style.scss\ntouch functions.php style.css\n<\/code><\/pre>\n<p>\u3053\u306e\u6642\u70b9\u3067<code>wp-scripts<\/code>\u3092\u8a2d\u5b9a\u3057\u3001<code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u95a2\u9023\u30b3\u30de\u30f3\u30c9\u3067\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">{\n  \"scripts\": {\n    \"build\": \"wp-scripts build\",\n    \"start\": \"wp-scripts start\",\n    \"lint:js\": \"wp-scripts lint-js\",\n    \"lint:css\": \"wp-scripts lint-style\",\n    \"test\": \"wp-scripts test-unit-js\"\n  }\n}\n<\/code><\/pre>\n<p>\u3053\u308c\u3092\u767a\u5c55\u3055\u305b\u3066\u3001webpack\u3001ESLint\u3001stylelint\u306e\u8a2d\u5b9a\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u518d\u5229\u7528\u53ef\u80fd\u306a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u3057\u3066\u7c21\u5358\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u306b\u306f\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/what-is-github\/\">GitHub\u30ea\u30dd\u30b8\u30c8\u30ea<\/a>\u3092\u4f7f\u3046\u306e\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u30ea\u30e2\u30fc\u30c8\u30aa\u30ea\u30b8\u30f3\u3068\u3057\u3066<code>https:\/\/github.com\/your-agency\/theme-template.git<\/code>\u306e\u3088\u3046\u306aURL\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u7acb\u3061\u4e0a\u3052\u308b\u969b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7c21\u5358\u306a\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npx create-wordpress-theme@latest my-new-theme --template your-agency\/theme-template\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u304c\u8907\u88fd\u3055\u308c\u3001\u3042\u3089\u304b\u3058\u3081\u5b9a\u7fa9\u3057\u305f<code>wp-scripts<\/code>\u306e\u8a2d\u5b9a\u3067\u30c6\u30fc\u30de\u304c\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3088\u304f\u4f7f\u7528\u3059\u308b\u95a2\u6570\u3084\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306a\u3069\u3001\u56fa\u6709\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u3055\u3089\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u3082\u3002\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306f\u3001\u6700\u65b0\u306e<code>wp-scripts<\/code>\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3001\u6c7a\u307e\u3063\u305f\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u6539\u5584\u3092\u53d6\u308a\u5165\u308c\u3066\u3001\u5e38\u306b\u6700\u65b0\u306e\u72b6\u614b\u306b\u4fdd\u3064\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<h3>\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3068\u30b3\u30e9\u30dc\u30ec\u30fc\u30b7\u30e7\u30f3<\/h3>\n<p><code>wp-scripts<\/code>\u3092\u4f7f\u7528\u3059\u308b\u4f5c\u696d\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u306b\u95a2\u3057\u3066\u306f\u3001\u3055\u3089\u306b\u591a\u304f\u306e\u3053\u3068\u3092\u5b9f\u3052M\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u4fdd\u3064\u305f\u3081\u3001\u901a\u5e38\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u53d6\u308a\u5165\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><code>package.json<\/code>\u3068<code>package-lock.json<\/code>\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u306b\u542b\u3081\u308b\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30c1\u30fc\u30e0\u9593\u3067\u7d71\u4e00\u3057\u3066\u540c\u3058\u4f9d\u5b58\u95a2\u4fc2\u3092\u4f7f\u7528\u3067\u304d\u308b\u3002<\/li>\n<li><code>.gitignore<\/code>\u30d5\u30a1\u30a4\u30eb\u306b<strong>\/build<\/strong>\u3084<strong>\/node_modules<\/strong>\u306a\u3069\u306e\u30d3\u30eb\u30c9\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8\u3092\u5fc5\u305a\u542b\u3081\u308b\u3002<\/li>\n<li>\u30b3\u30df\u30c3\u30c8\u3059\u308b\u524d\u306b\u3001<code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u5fc5\u8981\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u3059\u3079\u3066\u53c2\u7167\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/li>\n<li><code>.nvmrc<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u6b63\u3057\u3044Node.js\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3002<\/li>\n<\/ul>\n<p><a href=\"https:\/\/typicode.github.io\/husky\/\">Husky<\/a>\u306e\u3088\u3046\u306a\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/git-hooks\/\">\u30b3\u30df\u30c3\u30c8\u524d\u306e\u30d5\u30c3\u30af<\/a>\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u4ee5\u4e0b\u306f\u4e00\u4f8b\u3067\u3059\u304c\u3001\u30b3\u30df\u30c3\u30c8\u524d\u306b\u30ea\u30f3\u30c8\u3092\u884c\u3046\u306e\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-json\">\u2026\n\"husky\": {\n    \"hooks\": {\n        \"pre-commit\": \"npm run lint:js && npm run lint:css\"\n    }\n}\n\u2026\n<\/code><\/pre>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u30b3\u30df\u30c3\u30c8\u3084\u30d7\u30c3\u30b7\u30e5\u306e\u524d\u306b\u81ea\u52d5\u7684\u306b\u30ea\u30f3\u30c8\u3084\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002\u30c1\u30fc\u30e0\u5168\u4f53\u3067\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u7dad\u6301\u3067\u304d\u308b\u3082\u30461\u3064\u306e\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<h3>\u7d99\u7d9a\u7684\u30a4\u30f3\u30c6\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u7d99\u7d9a\u7684\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\uff08CI\/CD\uff09<\/h3>\n<p><code>wp-scripts<\/code>\u3092CI\/CD\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306b\u7d71\u5408\u3059\u308b\u3053\u3068\u3067\u3001\u30c6\u30fc\u30de\u3068\u30d7\u30e9\u30b0\u30a4\u30f3\u4e21\u65b9\u306e\u30c7\u30d7\u30ed\u30a4\u30d7\u30ed\u30bb\u30b9\u3092\u52b9\u7387\u5316\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/how-to-setup-ci-cd-pipeline\/\">GitHub Actions<\/a>\u3092\u4f7f\u3063\u3066<code>wp-scripts<\/code>\u306e\u8a2d\u5b9a\u306b\u7d71\u5408\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u306e<strong>workflows<\/strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5c02\u7528\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-json\">name: CI\/CD\n\non:\n  push:\n    branches: [ main ]\n  pull_request:\n    branches: [ main ]\njobs:\n  build-and-test:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions\/checkout@v2\n    - name: Use Node.js\n      uses: actions\/setup-node@v2\n      with:\n        node-version: '14'\n    - name: Cache dependencies\n      uses: actions\/cache@v2\n      with:\n        path: ~\/.npm\n        key: ${{ runner.OS }}-node-${{ hashFiles('**\/package-lock.json') }}\n    - name: Install dependencies\n      run: npm ci\n    - name: Run linters\n      run: |\n        npm run lint:js\n        npm run lint:css\n    - name: Run tests\n      run: npm run test\n    - name: Build\n      run: npm run build\n    - name: Deploy\n      if: github.ref == 'refs\/heads\/main'\n      run: |\n        # \u3053\u3053\u306b\u30c7\u30d7\u30ed\u30a4\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8ffd\u52a0\n        # \u4f8b\u3048\u3070\u3001\u30ea\u30e2\u30fc\u30c8\u30b5\u30fc\u30d0\u30fc\u306brsync\u3092\u4f7f\u3046\u5834\u5408\uff1a\n        # rsync -avzc --delete .\/build\/ user@example.com:\/path\/to\/wp-content\/themes\/your-theme\/\n<\/code><\/pre>\n<p>\u30c7\u30d7\u30ed\u30a4\u624b\u9806\u306f\u30db\u30b9\u30c8\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u3001rsync\u3092\u4f7f\u3063\u305f\u308a\u3001<a href=\"https:\/\/www.deployhq.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">DeployHQ<\/a>\u3084<a href=\"https:\/\/kinsta.com\/partners\/buddy\/\">Buddy<\/a>\u306e\u3088\u3046\u306a\u30b5\u30fc\u30d3\u30b9\u3068\u7d71\u5408\u3057\u305f\u308a\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/how-to-setup-ci-cd-pipeline\/#trigger-deployment-with-curl-in-cicd-pipeline\">\u30b7\u30f3\u30d7\u30eb\u306bcURL\u3067\u7d71\u5408<\/a>\u3057\u305f\u308a\u3057\u307e\u3059\u3002\u30c7\u30d7\u30ed\u30a4\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u3084\u30ad\u30fc\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001GitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u306b\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u3068\u3057\u3066\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306f\u3001\u30d7\u30c3\u30b7\u30e5\u3084\u30d7\u30eb\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u305f\u3073\u306blint\u3001\u30c6\u30b9\u30c8\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d3\u30eb\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u30e1\u30a4\u30f3\u30d6\u30e9\u30f3\u30c1\u306b\u5909\u66f4\u3092\u30d7\u30c3\u30b7\u30e5\u3057\u305f\u6642\u306b\u3060\u3051\u30c7\u30d7\u30ed\u30a4\u3055\u308c\u308b\u306e\u304c\u4fbf\u5229\u306a\u7279\u5fb4\u3067\u3059\u3002<\/p>\n<h3>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\uff08CLI\uff09\u30c4\u30fc\u30eb\u306e\u4f5c\u6210<\/h3>\n<p>\u30ab\u30b9\u30bf\u30e0\u30c4\u30fc\u30eb\u304c\u5fc5\u8981\u306a\u5834\u5408\u3082\u3001<code>wp-scripts<\/code>\u304c\u4e00\u5f79\u8cb7\u3063\u3066\u304f\u308c\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4f1a\u793e\u306e\u8981\u4ef6\u306b\u5fdc\u3058\u305f\u72ec\u81ea\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\uff08CLI\uff09\u30c4\u30fc\u30eb\u3092\u30c7\u30d7\u30ed\u30a4\u3057\u305f\u3044\u3053\u3068\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u3001\u30c4\u30fc\u30eb\u306b\u3044\u304f\u3064\u304b\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm install @wordpress\/scripts commander chalk\n<\/code><\/pre>\n<p>\u4e0a\u306e\u4f8b\u3067\u306f\u3001<a href=\"https:\/\/www.npmjs.com\/package\/commander\" target=\"_blank\" rel=\"noopener noreferrer\">Commander<\/a>\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u3092\u89e3\u6790\u3057\u3001<a href=\"https:\/\/www.npmjs.com\/package\/chalk\" target=\"_blank\" rel=\"noopener noreferrer\">chalk<\/a>\u306f\u51fa\u529b\u30c6\u30ad\u30b9\u30c8\u306e\u8996\u899a\u7684\u306a\u8868\u793a\u3092\u6539\u5584\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u304b\u3089\u3001<code>wp-scripts<\/code>\u3092\u6d3b\u7528\u3057\u305f\u30c4\u30fc\u30eb\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u59cb\u3081\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">#!\/usr\/bin\/env node\nconst { program } = require('commander');\nconst { spawn } = require('child_process');\nconst path = require('path');\nconst chalk = require('chalk');\n\nconst wpScripts = path.resolve(__dirname, '.\/node_modules\/.bin\/wp-scripts');\n\nconst runWpScripts = (script, args) =&gt; {\n  console.log(chalk.blue(`wp-scripts ${script} \u3092\u5b9f\u884c\u4e2d...`));\n  const result = spawn(wpScripts, [script, ...args], { stdio: 'inherit' });\n  result.on('exit', (code) =&gt; {\n    if (code !== 0) {\n      console.log(chalk.red(`wp-scripts ${script} failed with code ${code}`));\n    }\n  });\n};\n\nprogram\n  .version('1.0.0')\n  .description('\u30a8\u30fc\u30b8\u30a7\u30f3\u30b7\u30fcXYZ\u306e\u305f\u3081\u306e\u30ab\u30b9\u30bf\u30e0WordPress\u958b\u767aCLI');\n\nprogram\n  .command('build')\n  .description('\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u7bc9')\n  .action(() =&gt; runWpScripts('build'));\n\nprogram\n  .command('start')\n  .description('\u958b\u767a\u30b5\u30fc\u30d0\u30fc\u306e\u8d77\u52d5')\n  .action(() =&gt; runWpScripts('start'));\n\nprogram\n  .command('lint')\n  .description('JavaScript\u3068CSS\u30d5\u30a1\u30a4\u30eb\u306e\u30ea\u30f3\u30c8')\n  .action(() =&gt; {\n    runWpScripts('lint-js');\n    runWpScripts('lint-style');\n  });\n\nprogram\n  .command('test')\n  .description('\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u306e\u5b9f\u884c')\n  .action(() =&gt; runWpScripts('test-unit-js'));\n\nprogram\n  .command('deploy')\n  .description('\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30c7\u30d7\u30ed\u30a4')\n  .action(() =&gt; {\n    console.log(chalk.green('\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c7\u30d7\u30ed\u30a4\u4e2d...'));\n    \/\/ \u3053\u3053\u306b\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u30ed\u30b8\u30c3\u30af\u3092\u8ffd\u52a0\n    \/\/ \u4f8b\u3048\u3070\uff1a\n    \/\/ spawn('rsync', ['-avz', 'build\/', 'user@server:\/path\/to\/wordpress\/wp-content\/themes\/your-theme\/']);\n  });\n\nprogram.parse(process.argv);\n<\/code><\/pre>\n<p>package.json\u30d5\u30a1\u30a4\u30eb\u306bbin\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001CLI\u30c4\u30fc\u30eb\u3092\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">\u2026\n{\n  \"name\": \"agency-wp-cli\",\n  \"version\": \"1.0.0\",\n  \"bin\": {\n    \"agency-wp\": \".\/cli.js\"\n  },\n  \/\/ \u305d\u306e\u4ed6\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\n}\n\u2026\n<\/code><\/pre>\n<p>CLI\u3092\u30ed\u30fc\u30ab\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u30ea\u30f3\u30af\u3059\u308b\u306b\u306f\u3001<code>npm link<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002\u3053\u308c\u3067\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067CLI\u3092\u30c6\u30b9\u30c8\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">agency-wp build\nagency-wp lint\nagency-wp deploy\n<\/code><\/pre>\n<p>\u4ed6\u306e\u30e1\u30f3\u30d0\u30fc\u304c\u81ea\u7531\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3088\u3046\u3001\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u306anpm\u30ec\u30b8\u30b9\u30c8\u30ea\u306b\u30c4\u30fc\u30eb\u3092\u516c\u958b\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm publish --registry=<a href=\"https:\/\/your-private-registry.com\">https:\/\/your-private-registry.com<\/a>\n<\/code><\/pre>\n<p>\u5fc5\u8981\u6642\u306b<code>npm install --save-dev agency-wp-cli<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3001\u30c4\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u304b\u3089<code>package.json<\/code>\u306eCLI\u3092\u53c2\u7167\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">{\n  \"scripts\": {\n    \"build\": \"agency-wp build\",\n    \"start\": \"agency-wp start\",\n    \"lint\": \"agency-wp lint\",\n    \"test\": \"agency-wp test\",\n    \"deploy\": \"agency-wp deploy\"\n  }\n}\n<\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306a\u30c4\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u793e\u5185\u306e\u5168\u54e1\u304c\u540c\u3058\u30b3\u30de\u30f3\u30c9\u3068\u30d7\u30ed\u30bb\u30b9\u3092\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u77db\u76fe\u3084\u30a8\u30e9\u30fc\u304c\u524a\u6e1b\u3055\u308c\u3001WordPress\u958b\u767a\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u304c\u3055\u3089\u306b\u52b9\u7387\u5316\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316<\/h3>\n<p>\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u591a\u3044WordPress\u30b5\u30a4\u30c8\u3092\u8907\u6570\u7ba1\u7406\u3059\u308b\u5834\u5408\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316\u304c\u30b5\u30a4\u30c8\u306e\u6210\u529f\u3092\u5de6\u53f3\u3057\u307e\u3059\u3002<code>wp-scripts<\/code>\u3067\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u9ad8\u5ea6\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>\u9ad8\u5ea6\u306a\u30b3\u30fc\u30c9\u5206\u5272<\/h4>\n<p>\u305f\u3068\u3048\u3070\u3001\u30b3\u30fc\u30c9\u5206\u5272\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001JavaScript\u30d0\u30f3\u30c9\u30eb\u3092\u5c0f\u3055\u306a\u584a\u306b\u5206\u5272\u3057\u3001\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u5927\u898f\u6a21\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u306b\u3088\u308a\u6700\u521d\u306e\u8aad\u307f\u8fbc\u307f\u6642\u9593\u304c\u77ed\u7e2e\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u6700\u521d\u306b<code>webpack.config.js<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u4fee\u6b63\u3057\u3066\u3001\u30b3\u30fc\u30c9\u5206\u5272\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">const defaultConfig = require('@wordpress\/scripts\/config\/webpack.config');\n\nmodule.exports = {\n  ...defaultConfig,\n  entry: {\n    main: '.\/src\/index.js',\n    admin: '.\/src\/admin.js',\n  },\n  output: {\n    filename: '[name].js',\n    chunkFilename: '[name].[contenthash].js',\n  },\n  optimization: {\n    ...defaultConfig.optimization,\n    splitChunks: {\n      chunks: 'all',\n      minSize: 0,\n      cacheGroups: {\n        vendor: {\n          test: \/[\\\/]node_modules[\\\/]\/,\n          name(module) {\n            const packageName = module.context.match(\/[\\\/]node_modules[\\\/](.*?)([\\\/]|$)\/)[1];\n            return `vendor.${packageName.replace('@', '')}`;\n          },\n        },\n      },\n    },\n  },\n};\n<\/code><\/pre>\n<p>JavaScript\u306e\u30b3\u30fc\u30c9\u5168\u4f53\u3092\u901a\u3057\u3066\u3001\u52d5\u7684\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u5c0f\u3055\u306a\u584a\u306b\u5206\u5272\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">\/\/ \u4ee3\u308f\u308a\u306b: import { heavyFunction } from '.\/heavyModule';\n\nbutton.addEventListener('click', () =&gt; {\n  import('.\/heavyModule').then(module =&gt; {\n    module.heavyFunction();\n  });\n});\n<\/code><\/pre>\n<p>\u307e\u305f\u3001WordPress\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u5404\u5206\u5272\u3092\u30a8\u30f3\u30ad\u30e5\u30fc\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-php\">function enqueue_split_scripts() {\n  $asset_file = include(get_template_directory() . '\/build\/index.asset.php');  \n\n  wp_enqueue_script('main', get_template_directory_uri() . '\/build\/main.js', $asset_file['dependencies'], $asset_file['version'], true);\n  wp_enqueue_script('admin', get_template_directory_uri() . '\/build\/admin.js', $asset_file['dependencies'], $asset_file['version'], true);\n}\nadd_action('wp_enqueue_scripts', 'enqueue_split_scripts');\n<\/code><\/pre>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u8aad\u307f\u8fbc\u307f\u6642\u9593\u304c\u77ed\u7e2e\u3055\u308c\u3001\u5b9f\u88c5\u306b\u3082\u305d\u308c\u307b\u3069\u6642\u9593\u306f\u304b\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\n<h4>Tree shaking<\/h4>\n<p>Tree shaking\u3068\u306f\u3001JavaScript\u306e\u6587\u8108\u3067\u306f\u672a\u4f7f\u7528\u306e\u30b3\u30fc\u30c9\u3092\u53d6\u308a\u9664\u304f\u3053\u3068\u3067\u3059\u3002<code>wp-scripts<\/code>\u3068<code>webpack<\/code>\u306e\u3044\u305a\u308c\u3082\u3001\u672c\u756a\u306e\u30d3\u30eb\u30c9\u3067\u306fTree shaking\u3092\u884c\u3044\u307e\u3059\u304c\u3001\u3055\u3089\u306b\u6700\u9069\u5316\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u4ee5\u4e0b\u306b\u3054\u8aac\u660e\u3059\u308b\u3088\u308a\u3082\u8907\u96d1\u3067\u3059\u304c\u3001\u3044\u305a\u308c\u306b\u3057\u3066\u3082ES6\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u304a\u3088\u3073\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u69cb\u6587\u306f\u78ba\u5b9f\u306b\u4f7f\u7528\u3057\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-php\">\/\/ Tree shaking\u306b\u9069\u3057\u3066\u3044\u308b\nexport function usedFunction() { \/* ... *\/ }\n\n\/\/ Tree shaking\u306b\u9069\u3057\u3066\u3044\u306a\u3044\nmodule.exports = {\n  usedFunction: function() { \/* ... *\/ },\n};\n<\/code><\/pre>\n<p>\u6b21\u306b\u3001<a href=\"https:\/\/travislramos.com\/blog\/understanding-tree-shaking-in-javascript\" target=\"_blank\" rel=\"noopener noreferrer\">\u526f\u4f5c\u7528<\/a>\u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">{\n  \"name\": \"your-package\",\n  \"sideEffects\": [\"*.css\", \"*.scss\"]\n}\n<\/code><\/pre>\n<p>\u307e\u305f\u306f\u526f\u4f5c\u7528\u3092\u6301\u305f\u306a\u3044\u3053\u3068\u3092\u660e\u793a\u7684\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-json\">{\n  \"name\": \"your-package\",\n  \"sideEffects\": false\n}\n<\/code><\/pre>\n<p>\u5927\u898f\u6a21\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4e2d\u306b\u306f\u3001Tree shaking\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u306a\u3044\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306f\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code class=\"language-bash\">npm install --save-dev babel-plugin-transform-imports\n<\/code><\/pre>\n<p>\u30a8\u30e9\u30fc\u306e\u306a\u3044\u6700\u9069\u5316\u3055\u308c\u305f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001babel\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3082\u66f4\u65b0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h4>\u30a2\u30bb\u30c3\u30c8\u306e\u6700\u9069\u5316<\/h4>\n<p><code>wp-scripts<\/code>\u306e\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u306f\u3001CSS\u3068JavaScript\u30d5\u30a1\u30a4\u30eb\u3092\u81ea\u52d5\u3067\u6700\u5c0f\u5316\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u7279\u5b9a\u306e\u753b\u50cf\u6700\u9069\u5316\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm install --save-dev imagemin-webpack-plugin\n<\/code><\/pre>\n<p>\u3053\u308c\u3092webpack\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u3068\u3001<code>functions.php<\/code>\u30d5\u30a1\u30a4\u30eb\u307e\u305f\u306f\u30e1\u30a4\u30f3\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u30d5\u30a1\u30a4\u30eb\u306b\u9069\u5207\u306a\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u30ea\u30bd\u30fc\u30b9\u30d2\u30f3\u30c8\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-php\">function add_resource_hints( $urls, $relation_type ) {\n  if ( 'preconnect' === $relation_type ) {\n    $urls[] = 'https:\/\/fonts.googleapis.com';\n    $urls[] = 'https:\/\/fonts.gstatic.com';\n  }\n  return $urls;\n}\n\nadd_filter( 'wp_resource_hints', 'add_resource_hints', 10, 2 );\n<\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306a\u30bf\u30b9\u30af\u304b\u3089\u3001<code>wp-scripts<\/code>\u306e\u67d4\u8edf\u6027\u304c\u3046\u304b\u304c\u3048\u307e\u3059\u3002<\/p>\n<h4>\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u306e\u5206\u6790<\/h4>\n<p>\u6700\u9069\u5316\u306b\u306f\u3001\u30d0\u30f3\u30c9\u30eb\u306e\u69cb\u6210\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<code>wp-scripts<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001<code>--analyze<\/code>\u30d5\u30e9\u30b0\u3067\u7c21\u5358\u306b\u5206\u6790\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm run build -- --analyze\n<\/code><\/pre>\n<p>\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001<code>package.json<\/code>\u30d5\u30a1\u30a4\u30eb\u306b\u95a2\u9023\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-json\">{\n  \"scripts\": {\n    \"analyze\": \"wp-scripts build --analyze\"\n  }\n}\n<\/code><\/pre>\n<p><code>analyze<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30d0\u30f3\u30c9\u30eb\u5185\u306e\u5404\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u793a\u3059\u30ec\u30dd\u30fc\u30c8\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u5b9f\u88c5\u306f\u3001\u6700\u9069\u5316\u306e\u305f\u3081\u306e\u9818\u57df\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<h4>\u91cd\u8981\u306aCSS\u306e\u5b9f\u88c5<\/h4>\n<p>\u30b5\u30a4\u30c8\u306e\u30af\u30ea\u30c6\u30a3\u30ab\u30ebCSS\u306f\u3001\u30da\u30fc\u30b8\u304cAbove the fold\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306b\u5fc5\u8981\u306a\u6700\u4f4e\u9650\u306eCSS\u3067\u3059\u3002\u3053\u306eCSS\u3092\u30a4\u30f3\u30e9\u30a4\u30f3\u306b\u914d\u7f6e\u3059\u308b\u3053\u3068\u3067\u3001\u8aad\u307f\u8fbc\u307f\u6642\u9593\u3092\u6539\u5584\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001<a href=\"https:\/\/www.npmjs.com\/package\/critical-css-webpack-plugin\" target=\"_blank\" rel=\"noopener noreferrer\">Critical CSS Webpack<\/a>\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm install --save-dev critical-css-webpack-plugin\n<\/code><\/pre>\n<p>\u7d9a\u3044\u3066\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u53c2\u7167\u3059\u308b\u3088\u3046\u306bwebpack\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-js\">const CriticalCssPlugin = require('critical-css-webpack-plugin');\nconst defaultConfig = require('@wordpress\/scripts\/config\/webpack.config');\n\nmodule.exports = {\n  ...defaultConfig,\n  plugins: [\n    ...defaultConfig.plugins,\n    new CriticalCssPlugin({\n      base: 'dist\/',\n      src: 'index.html',\n      target: 'styles\/critical.css',\n      extract: true,\n      inline: true,\n      minify: true,\n      dimensions: [\n        {\n          height: 500,\n          width: 300,\n        },\n        {\n          height: 900,\n          width: 1300,\n        },\n      ],\n    }),\n  ],\n};\n<\/code><\/pre>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001<code>header.php<\/code>\u30d5\u30a1\u30a4\u30eb\u306b\u30b9\u30cb\u30da\u30c3\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-php\">&lt;style&gt;\n  &lt;?php echo file_get_contents(get_template_directory() . '\/build\/styles\/critical.css'); ?&gt;\n&lt;\/style&gt;\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306f\u521d\u671f\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u91cd\u8981\u306aCSS\u3092\u62bd\u51fa\u3057\u3001\u30a4\u30f3\u30e9\u30a4\u30f3\u5316\u3059\u308b\u3082\u306e\u3067\u3059\u3002\u7279\u5b9a\u306e\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u30b5\u30a4\u30ba\u306b\u5bfe\u5fdc\u3059\u308b\u91cd\u8981\u306aCSS\u3092\u751f\u6210\u3057\u3001\u30c6\u30fc\u30de\u306e\u8aad\u307f\u8fbc\u307f\u6642\u9593\u3092\u6539\u5584\u3057\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Web\u5236\u4f5c\u4f1a\u793e\u3084\u4ee3\u884c\u696d\u8005\u306b\u3068\u3063\u3066\u3001<code>wp-scripts<\/code>\u306f\u3001\u30c6\u30fc\u30de\u3068\u30d7\u30e9\u30b0\u30a4\u30f3\u4e21\u65b9\u306e\u958b\u767a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u3092\u5927\u5e45\u306b\u5f37\u5316\u3067\u304d\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u6a19\u6e96\u5316\u3055\u308c\u305f\u30d3\u30eb\u30c9\u30d7\u30ed\u30bb\u30b9\u3001\u30e2\u30c0\u30f3JavaScript\u306e\u30b5\u30dd\u30fc\u30c8\u3001\u7d71\u5408\u3055\u308c\u305f\u30c6\u30b9\u30c8\u3068\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u30c4\u30fc\u30eb\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u91cd\u8981\u306a\u30bf\u30b9\u30af\u306e\u4e00\u90e8\u3092\u81ea\u52d5\u5316\u3057\u306a\u304c\u3089\u3001\u512a\u308c\u305fWordPress\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u958b\u767a\u306b\u96c6\u4e2d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code>wp-scripts<\/code>\u3067\u6700\u65b0\u306e\u958b\u767a\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u3060\u3051\u3067\u306a\u304f\u3001WordPress\u958b\u767a\u306e\u6700\u524d\u7dda\u306b\u7acb\u3061\u3001\u5236\u4f5c\u4f1a\u793e\u304c\u906d\u9047\u3057\u304c\u3061\u306a\u8ab2\u984c\u306b\u5bfe\u51e6\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u5236\u4f5c\u4f1a\u793e\u3084\u4ee3\u884c\u696d\u8005\u306eWordPress\u958b\u767a\u696d\u52d9 &#8230;<\/p>\n","protected":false},"author":259,"featured_media":62159,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kinsta_gated_content":false,"_kinsta_gated_content_redirect":"","footnotes":""},"tags":[],"topic":[878,839,826,832],"class_list":["post-62158","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","topic-agency","topic-wordpress-website-design","topic-wordpress-development","topic-wordpress-performance"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.6 (Yoast SEO v24.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5<\/title>\n<meta name=\"description\" content=\"\u52b9\u7387\u7684\u3067\u9ad8\u5ea6\u306aWordPress\u958b\u767a\u306b\u306f\u3001\u4e00\u6d41\u306e\u30c4\u30fc\u30eb\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002\u4eca\u56de\u306fwp-scripts\u306e\u4f7f\u7528\u65b9\u6cd5\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u30c6\u30b9\u30c8\u306a\u3069\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"\u52b9\u7387\u7684\u3067\u9ad8\u5ea6\u306aWordPress\u958b\u767a\u306b\u306f\u3001\u4e00\u6d41\u306e\u30c4\u30fc\u30eb\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002\u4eca\u56de\u306fwp-scripts\u306e\u4f7f\u7528\u65b9\u6cd5\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u30c6\u30b9\u30c8\u306a\u3069\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/\" \/>\n<meta property=\"og:site_name\" content=\"Kinsta\u00ae\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Kinsta-Japan-334616080691171\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-02T09:24:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-10T14:30:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1470\" \/>\n\t<meta property=\"og:image:height\" content=\"735\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Steve Bonisteel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:description\" content=\"\u52b9\u7387\u7684\u3067\u9ad8\u5ea6\u306aWordPress\u958b\u767a\u306b\u306f\u3001\u4e00\u6d41\u306e\u30c4\u30fc\u30eb\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002\u4eca\u56de\u306fwp-scripts\u306e\u4f7f\u7528\u65b9\u6cd5\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u30c6\u30b9\u30c8\u306a\u3069\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package-1024x512.png\" \/>\n<meta name=\"twitter:creator\" content=\"@Kinsta_JP\" \/>\n<meta name=\"twitter:site\" content=\"@Kinsta_JP\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Steve Bonisteel\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"7\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/\"},\"author\":{\"name\":\"Steve Bonisteel\",\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/person\/d84ceff87bd64a4368a581fc8aa8bd6f\"},\"headline\":\"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5\",\"datePublished\":\"2024-12-02T09:24:32+00:00\",\"dateModified\":\"2024-12-10T14:30:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/\"},\"wordCount\":279,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kinsta.com\/jp\/#organization\"},\"image\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/\",\"url\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/\",\"name\":\"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5\",\"isPartOf\":{\"@id\":\"https:\/\/kinsta.com\/jp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png\",\"datePublished\":\"2024-12-02T09:24:32+00:00\",\"dateModified\":\"2024-12-10T14:30:06+00:00\",\"description\":\"\u52b9\u7387\u7684\u3067\u9ad8\u5ea6\u306aWordPress\u958b\u767a\u306b\u306f\u3001\u4e00\u6d41\u306e\u30c4\u30fc\u30eb\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002\u4eca\u56de\u306fwp-scripts\u306e\u4f7f\u7528\u65b9\u6cd5\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u30c6\u30b9\u30c8\u306a\u3069\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#primaryimage\",\"url\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png\",\"contentUrl\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png\",\"width\":1470,\"height\":735},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kinsta.com\/jp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress\u30b5\u30a4\u30c8\u958b\u767a\",\"item\":\"https:\/\/kinsta.com\/jp\/topics\/wordpress-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kinsta.com\/jp\/#website\",\"url\":\"https:\/\/kinsta.com\/jp\/\",\"name\":\"Kinsta\u00ae\",\"description\":\"\u9ad8\u901f\u304b\u3064\u5805\u7262\u306a\u30d7\u30ec\u30df\u30a2\u30e0\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\",\"publisher\":{\"@id\":\"https:\/\/kinsta.com\/jp\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kinsta.com\/jp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kinsta.com\/jp\/#organization\",\"name\":\"Kinsta\",\"url\":\"https:\/\/kinsta.com\/jp\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/12\/kinsta-logo.jpeg\",\"contentUrl\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/12\/kinsta-logo.jpeg\",\"width\":500,\"height\":500,\"caption\":\"Kinsta\"},\"image\":{\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Kinsta-Japan-334616080691171\/\",\"https:\/\/x.com\/Kinsta_JP\",\"https:\/\/www.instagram.com\/kinstahosting\/\",\"https:\/\/www.linkedin.com\/company\/kinsta\/\",\"https:\/\/www.pinterest.com\/kinstahosting\/\",\"https:\/\/www.youtube.com\/c\/Kinsta\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/person\/d84ceff87bd64a4368a581fc8aa8bd6f\",\"name\":\"Steve Bonisteel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0adffb3f9c86a6ec8245f8399d540823?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0adffb3f9c86a6ec8245f8399d540823?s=96&d=mm&r=g\",\"caption\":\"Steve Bonisteel\"},\"description\":\"Steve Bonisteel is a Technical Editor at Kinsta who began his writing career as a print journalist, chasing ambulances and fire trucks. He has been covering Internet-related technology since the late 1990s.\",\"url\":\"https:\/\/kinsta.com\/jp\/blog\/author\/stevebonisteel\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5","description":"\u52b9\u7387\u7684\u3067\u9ad8\u5ea6\u306aWordPress\u958b\u767a\u306b\u306f\u3001\u4e00\u6d41\u306e\u30c4\u30fc\u30eb\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002\u4eca\u56de\u306fwp-scripts\u306e\u4f7f\u7528\u65b9\u6cd5\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u30c6\u30b9\u30c8\u306a\u3069\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/","og_locale":"ja_JP","og_type":"article","og_title":"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5","og_description":"\u52b9\u7387\u7684\u3067\u9ad8\u5ea6\u306aWordPress\u958b\u767a\u306b\u306f\u3001\u4e00\u6d41\u306e\u30c4\u30fc\u30eb\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002\u4eca\u56de\u306fwp-scripts\u306e\u4f7f\u7528\u65b9\u6cd5\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u30c6\u30b9\u30c8\u306a\u3069\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002","og_url":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/","og_site_name":"Kinsta\u00ae","article_publisher":"https:\/\/www.facebook.com\/Kinsta-Japan-334616080691171\/","article_published_time":"2024-12-02T09:24:32+00:00","article_modified_time":"2024-12-10T14:30:06+00:00","og_image":[{"width":1470,"height":735,"url":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png","type":"image\/png"}],"author":"Steve Bonisteel","twitter_card":"summary_large_image","twitter_description":"\u52b9\u7387\u7684\u3067\u9ad8\u5ea6\u306aWordPress\u958b\u767a\u306b\u306f\u3001\u4e00\u6d41\u306e\u30c4\u30fc\u30eb\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002\u4eca\u56de\u306fwp-scripts\u306e\u4f7f\u7528\u65b9\u6cd5\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u30c6\u30b9\u30c8\u306a\u3069\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002","twitter_image":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package-1024x512.png","twitter_creator":"@Kinsta_JP","twitter_site":"@Kinsta_JP","twitter_misc":{"\u57f7\u7b46\u8005":"Steve Bonisteel","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"7\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#article","isPartOf":{"@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/"},"author":{"name":"Steve Bonisteel","@id":"https:\/\/kinsta.com\/jp\/#\/schema\/person\/d84ceff87bd64a4368a581fc8aa8bd6f"},"headline":"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5","datePublished":"2024-12-02T09:24:32+00:00","dateModified":"2024-12-10T14:30:06+00:00","mainEntityOfPage":{"@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/"},"wordCount":279,"commentCount":0,"publisher":{"@id":"https:\/\/kinsta.com\/jp\/#organization"},"image":{"@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#primaryimage"},"thumbnailUrl":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/","url":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/","name":"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5","isPartOf":{"@id":"https:\/\/kinsta.com\/jp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#primaryimage"},"image":{"@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#primaryimage"},"thumbnailUrl":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png","datePublished":"2024-12-02T09:24:32+00:00","dateModified":"2024-12-10T14:30:06+00:00","description":"\u52b9\u7387\u7684\u3067\u9ad8\u5ea6\u306aWordPress\u958b\u767a\u306b\u306f\u3001\u4e00\u6d41\u306e\u30c4\u30fc\u30eb\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002\u4eca\u56de\u306fwp-scripts\u306e\u4f7f\u7528\u65b9\u6cd5\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3001\u30ea\u30f3\u30c6\u30a3\u30f3\u30b0\u3001\u30c6\u30b9\u30c8\u306a\u3069\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#primaryimage","url":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png","contentUrl":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2024\/12\/advanced-wordpress-development-with-the-wordpress-scripts-package.png","width":1470,"height":735},{"@type":"BreadcrumbList","@id":"https:\/\/kinsta.com\/jp\/blog\/wp-scripts-development\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kinsta.com\/jp\/"},{"@type":"ListItem","position":2,"name":"WordPress\u30b5\u30a4\u30c8\u958b\u767a","item":"https:\/\/kinsta.com\/jp\/topics\/wordpress-development\/"},{"@type":"ListItem","position":3,"name":"\u3010\u4e0a\u7d1a\u8005\u5411\u3051WordPress\u958b\u767a\u3011\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bwp-scripts\u3092\u7d44\u307f\u8fbc\u3080\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/kinsta.com\/jp\/#website","url":"https:\/\/kinsta.com\/jp\/","name":"Kinsta\u00ae","description":"\u9ad8\u901f\u304b\u3064\u5805\u7262\u306a\u30d7\u30ec\u30df\u30a2\u30e0\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9","publisher":{"@id":"https:\/\/kinsta.com\/jp\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kinsta.com\/jp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/kinsta.com\/jp\/#organization","name":"Kinsta","url":"https:\/\/kinsta.com\/jp\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/kinsta.com\/jp\/#\/schema\/logo\/image\/","url":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/12\/kinsta-logo.jpeg","contentUrl":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/12\/kinsta-logo.jpeg","width":500,"height":500,"caption":"Kinsta"},"image":{"@id":"https:\/\/kinsta.com\/jp\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Kinsta-Japan-334616080691171\/","https:\/\/x.com\/Kinsta_JP","https:\/\/www.instagram.com\/kinstahosting\/","https:\/\/www.linkedin.com\/company\/kinsta\/","https:\/\/www.pinterest.com\/kinstahosting\/","https:\/\/www.youtube.com\/c\/Kinsta"]},{"@type":"Person","@id":"https:\/\/kinsta.com\/jp\/#\/schema\/person\/d84ceff87bd64a4368a581fc8aa8bd6f","name":"Steve Bonisteel","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/kinsta.com\/jp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0adffb3f9c86a6ec8245f8399d540823?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0adffb3f9c86a6ec8245f8399d540823?s=96&d=mm&r=g","caption":"Steve Bonisteel"},"description":"Steve Bonisteel is a Technical Editor at Kinsta who began his writing career as a print journalist, chasing ambulances and fire trucks. He has been covering Internet-related technology since the late 1990s.","url":"https:\/\/kinsta.com\/jp\/blog\/author\/stevebonisteel\/"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/posts\/62158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/users\/259"}],"replies":[{"embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/comments?post=62158"}],"version-history":[{"count":8,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/posts\/62158\/revisions"}],"predecessor-version":[{"id":62175,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/posts\/62158\/revisions\/62175"}],"alternate":[{"embeddable":true,"hreflang":"en","title":"English","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/translations\/en"},{"embeddable":true,"hreflang":"it","title":"Italian","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/translations\/it"},{"embeddable":true,"hreflang":"pt","title":"Portuguese","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/translations\/pt"},{"embeddable":true,"hreflang":"fr","title":"French","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/translations\/fr"},{"embeddable":true,"hreflang":"de","title":"German","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/translations\/de"},{"embeddable":true,"hreflang":"ja","title":"Japanese","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/translations\/jp"},{"embeddable":true,"hreflang":"nl","title":"Dutch","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/translations\/nl"},{"embeddable":true,"hreflang":"es","title":"Spanish","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/translations\/es"},{"href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/62158\/tree"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/media\/62159"}],"wp:attachment":[{"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/media?parent=62158"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/tags?post=62158"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/topic?post=62158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}