{"id":335,"date":"2023-02-02T10:20:17","date_gmt":"2023-02-02T01:20:17","guid":{"rendered":"https:\/\/hirabay.net\/?p=335"},"modified":"2023-02-02T20:25:06","modified_gmt":"2023-02-02T11:25:06","slug":"lighthouse%e3%81%ae%e3%82%b9%e3%82%b3%e3%82%a2%e3%82%92%e8%87%aa%e5%8b%95%e3%81%a7%e8%a8%88%e6%b8%ac%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/hirabay.net\/?p=335","title":{"rendered":"Lighthouse\u306e\u30b9\u30b3\u30a2\u3092\u81ea\u52d5\u3067\u8a08\u6e2c\u3059\u308b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Web\u30b5\u30a4\u30c8\u3092\u4f5c\u3063\u3066\u3044\u308b\u3068\u30da\u30fc\u30b8\u306e\u5feb\u9069\u3055\u306e\u8a08\u6e2c\u306e\u305f\u3081\u306bLighthouse\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u65b9\u306f\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Lighthouse\u306e\u8a08\u6e2c\u306f\u3069\u306e\u3088\u3046\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u3059\u304b\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3088\u304f\u3042\u308b\u306e\u306fChrome\u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u65b9\u6cd5\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u8a08\u6e2c\u3059\u308b\u30da\u30fc\u30b8\u304c\u591a\u304f\u306a\u3063\u3066\u304f\u308b\u3068\u305d\u308c\u306a\u308a\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u3053\u3067\u3001\u3053\u306e\u8a18\u4e8b\u3067\u306fLighthouse\u306e\u8a08\u6e2c\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff01<\/p>\n\n\n\n<div class=\"wp-block-sgb-say\"><div class=\"sgb-block-say sgb-block-say--left\"><div class=\"sgb-block-say-avatar\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hirabay.net\/wp-content\/uploads\/2023\/01\/c90be45c419f1b74db0f1d5a262d000d.png\" alt=\"\u3072\u3089\u3079\u30fc\" width=\"80\" height=\"80\" style=\"border-color:#eaedf2\"><div class=\"sgb-block-say-avatar__name\">\u3072\u3089\u3079\u30fc<\/div><\/div><div class=\"sgb-block-say-text\"><div class=\"sgb-block-say-text__content\" style=\"color:#333;border-color:#d5d5d5;background-color:#FFF\">\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u306f\u3001\u3053\u3093\u306a\u4eba\u306b\u30aa\u30b9\u30b9\u30e1\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30fbLighthouse\u306e\u8a08\u6e2c\u3092\u3057\u3066\u3044\u308b \/ \u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30fbWeb\u30b5\u30a4\u30c8\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u81ea\u52d5\u3067\u8a08\u6e2c\u3057\u305f\u3044<\/p>\n<span class=\"sgb-block-say-text__before\" style=\"border-right-color:#d5d5d5\"><\/span><span class=\"sgb-block-say-text__after\" style=\"border-right-color:#FFF\"><\/span><\/div><\/div><\/div><\/div>\n\n\n\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/c4179872\/public_html\/hirabay.net\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>110<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/c4179872\/public_html\/hirabay.net\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>115<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/c4179872\/public_html\/hirabay.net\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>122<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">\n  <li class=\"first\">\n    <a href=\"#i-0\">\u5229\u7528\u3059\u308b\u30c4\u30fc\u30eb\u30fb\u30e9\u30a4\u30d6\u30e9\u30ea<\/a>\n  <\/li>\n  <li>\n    <a href=\"#i-1\">\u8a08\u6e2c\uff06\u5408\u5426\u5224\u5b9a\u624b\u9806<\/a>\n  <\/li>\n  <li>\n    <a href=\"#i-2\">\u521d\u671f\u69cb\u7bc9<\/a>\n    <ul class=\"menu_level_1\">\n      <li class=\"first\">\n        <a href=\"#i-3\">npm\u30b9\u30af\u30ea\u30d7\u30c8\u7de8\u96c6<\/a>\n      <\/li>\n      <li>\n        <a href=\"#i-4\">\u30ec\u30dd\u30fc\u30c8\u7528\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210<\/a>\n      <\/li>\n      <li class=\"last\">\n        <a href=\"#i-5\">\u5b9f\u884c<\/a>\n      <\/li>\n    <\/ul>\n  <\/li>\n  <li>\n    <a href=\"#i-6\">\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u89e3\u8aac<\/a>\n    <ul class=\"menu_level_1\">\n      <li class=\"first\">\n        <a href=\"#i-7\">prelh \/ postlh<\/a>\n      <\/li>\n      <li>\n        <a href=\"#i-8\">lh<\/a>\n      <\/li>\n      <li>\n        <a href=\"#i-9\">lh-template<\/a>\n      <\/li>\n      <li>\n        <a href=\"#i-10\">lh:yahoo \/ lh:google<\/a>\n      <\/li>\n      <li>\n        <a href=\"#i-11\">clean<\/a>\n      <\/li>\n      <li class=\"last\">\n        <a href=\"#i-12\">report<\/a>\n      <\/li>\n    <\/ul>\n  <\/li>\n  <li class=\"last\">\n    <a href=\"#i-13\">\u307e\u3068\u3081<\/a>\n  <\/li>\n<\/ul>\n\n      \n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">\u5229\u7528\u3059\u308b\u30c4\u30fc\u30eb\u30fb\u30e9\u30a4\u30d6\u30e9\u30ea<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lighthouse CLI<\/li>\n\n\n\n<li>npm-run-all<\/li>\n\n\n\n<li>rimraf<\/li>\n\n\n\n<li>mkdirp<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-1\">\u8a08\u6e2c\uff06\u5408\u5426\u5224\u5b9a\u624b\u9806<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e9\u901f\u3067\u3059\u304c\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u8a08\u6e2c\u3068\u5408\u5426\u5224\u5b9a\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\n\n\n<p><\/p><div class=\"memo \"><div class=\"memo_ttl dfont\"> \u30e1\u30e2<\/div>\u3053\u306e\u8a18\u4e8b\u3067\u306fLighthouse CLI\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br>\n\u4ed6\u306bLighthouse module\u3092\u5229\u7528\u3057\u3066javascript\u5185\u90e8\u3067Lighthouse\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001<br>\n\u5229\u7528\u3067\u304d\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u304cCLI\u306e\u65b9\u304c\u591a\u3044\u306e\u3067CLI\u3092\u9078\u629e\u3057\u3066\u3044\u307e\u3059\u3002<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-2\">\u521d\u671f\u69cb\u7bc9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u3068\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ npm init\n\n$ npm i lighthouse npm-run-all rimraf mkdirp<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">init\u306e\u9078\u629e\u306f\u3059\u3079\u3066\u30a8\u30f3\u30bf\u30fc\u3067OK\u3067\u3059\uff01\uff08\u4f7f\u3046\u3068\u3057\u3066\u3082\u500b\u4eba\u30fb\u793e\u5185\u306b\u9589\u3058\u305f\u3082\u306e\u306b\u306a\u308b\u306f\u305a\u306a\u306e\u3067\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-3\">npm\u30b9\u30af\u30ea\u30d7\u30c8\u7de8\u96c6<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u56de\u306fnpm\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u5177\u4f53\u7684\u306a\u30bf\u30b9\u30af\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8a73\u7d30\u306f\u5f8c\u7a0b\u89e3\u8aac\u3059\u308b\u306e\u3067\u307e\u305a\u306f\u5b8c\u6210\u3057\u305f\u3082\u306e\u3092<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-json\" data-file=\"package.json\" data-lang=\"Json\"><code>{\n  ...\n  \"scripts\": {\n    \"prelh\": \"npm run clean\",\n    \"lh\": \"run-p lh:*\",\n    \"postlh\": \"npm run report\",\n    \"lh-template\": \"lighthouse $npm_config_url --quiet --preset=desktop --chrome-flags=\\\"--headless\\\" --output json --output html --output-path .\/reports\/$npm_config_name\",\n    \"lh:yahoo\": \"npm run lh-template --url=https:\/\/yahoo.co.jp --name=yahoo\",\n    \"lh:google\": \"npm run lh-template --url=https:\/\/google.com --name=google\",\n    \"clean\": \"rimraf .\/reports &amp;&amp; mkdirp .\/reports\",\n    \"report\": \"node src\/report.js\"\n  },\n  ...\n}<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-4\">\u30ec\u30dd\u30fc\u30c8\u7528\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>src\/report.js<\/code>\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u5b9f\u88c5\u3057\u3001lighthouse\u306e\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-file=\"report.js\" data-lang=\"JavaScript\"><code>const fs = require('fs')\n\n\/\/ \u300c.\/reports\u300d\u914d\u4e0b\u306ejson\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u53d6\u5f97\nconst filenames = fs.readdirSync('reports').filter(it =&gt; it.endsWith(\".json\"))\n\nconst reports = {}\n\nfilenames.forEach(filename =&gt; {\n    \/\/ \u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u53d6\u5f97\n    const content = fs.readFileSync(`reports\/${filename}`).toString()\n    \/\/ json\u3067\u8aad\u8fbc\n    const json = JSON.parse(content)\n    \/\/ \u5404\u7a2e\u8a08\u6e2c\u7d50\u679c\u3092\u53d6\u5f97\uff08\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066performance\u306e\u30b9\u30b3\u30a2\u3092\u53d6\u5f97\uff09\n    const performance = json.categories.performance.score * 100\n    \n    \/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u304b\u3089npm\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u6307\u5b9a\u3057\u305f\u300cname\u300d\u90e8\u5206\u3092\u62bd\u51fa\n    const name = filename.match(\/(.+).report.json$\/)[1]\n\n    \/\/ \u30ec\u30dd\u30fc\u30c8\u306b\u8ffd\u52a0\n    reports[name] = {\n        performance\n    }\n})\n\n\/\/ \u30c6\u30fc\u30d6\u30eb\u5f62\u5f0f\u3067\u51fa\u529b\nconsole.table(reports)<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">\u5b9f\u884c<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>lh<\/code>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a08\u6e2c\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u307e\u3059\uff01<br>\u203b\u4e00\u5fdc\u6570\u5024\u306f\u30de\u30b9\u30ad\u30f3\u30b0\u3002\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ npm run lh\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 (index) \u2502 performance \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 google  \u2502     xx      \u2502\n\u2502  yahoo  \u2502     xx      \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305f\u3001<code>reports\/<\/code>\u914d\u4e0b\u306b\u751f\u6210\u3055\u308c\u308bHTML\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3059\u308b\u3068Chrome\u306e\u62e1\u5f35\u6a5f\u80fd\u306e\u3088\u3046\u306a\u30ec\u30dd\u30fc\u30c8\u3092\u898b\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-6\">\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u89e3\u8aac<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u307e\u3067\u3067\u81ea\u52d5\u3067\u8a08\u6e2c\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3068\u601d\u3046\u306e\u3067\u3001<br>\u3053\u3053\u304b\u3089\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u3054\u3068\u306b\u5185\u5bb9\u3092\u6df1\u5800\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-7\">prelh \/ postlh<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-json\" data-lang=\"Json\"><code>\"prelh\": \"npm run clean\",\n\"postlh\": \"npm run report\",<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">npm script\u3067\u306f\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u540d\u306e\u524d\u306b<code>pre<\/code>\u3084<code>post<\/code>\u3092\u4ed8\u3051\u305f\u547d\u540d\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u524d\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067\u306f\u3001<code>lh<\/code>\u306e\u4e8b\u524d\u306b<code>clean<\/code>\u30b9\u30af\u30ea\u30d7\u30c8\u30fb\u4e8b\u5f8c\u306b<code>report<\/code>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u5b9a\u7fa9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-8\">lh<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-json\" data-lang=\"JSON\"><code>\"lh\": \"run-p lh:*\",<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u3001npm-run-all\u3092\u5229\u7528\u3057\u3066<code>lh:yahoo<\/code>\u30b9\u30af\u30ea\u30d7\u30c8\u3068<code>lh:google<\/code>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4e26\u5217\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>run-p<\/code>\u306e\u5f8c\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5217\u6319\u3059\u308b\u3053\u3068\u3067\u8907\u6570\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4e26\u5217\u3067\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<br>\u307e\u305f\u3001<code>*<\/code>\u3092\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3068\u3057\u3066\u4f7f\u7528\u3067\u304d\u308b\u306e\u3067<code>lh:*<\/code>\u306e\u3088\u3046\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5217\u6319\u3059\u308b\u3053\u3068\u306a\u304f\u4e00\u62ec\u3067\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">npm-run-all\u306e\u4f7f\u3044\u65b9\u306f\u5225\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u6c17\u306b\u306a\u308b\u65b9\u306f\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<a class=\"linkto table\" href=\"https:\/\/hirabay.net\/?p=346\"><span class=\"tbcell tbimg\"><img loading=\"lazy\" decoding=\"async\" width=\"160\" height=\"160\" src=\"https:\/\/hirabay.net\/wp-content\/uploads\/2023\/02\/npm-run-all-160x160.png\" class=\"attachment-thumb-160 size-thumb-160 wp-post-image\" alt=\"\" srcset=\"https:\/\/hirabay.net\/wp-content\/uploads\/2023\/02\/npm-run-all-160x160.png 160w, https:\/\/hirabay.net\/wp-content\/uploads\/2023\/02\/npm-run-all-150x150.png 150w\" sizes=\"auto, (max-width: 160px) 100vw, 160px\"><\/span><span class=\"tbcell tbtext\"><time class=\"pubdate sng-link-time dfont\" itemprop=\"datePublished\" datetime=\"2023-02-02\">2023\u5e742\u67082\u65e5<\/time>\u3010npm\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4e26\u5217\u5b9f\u884c\uff01\u3011npm-run-all\u306e\u4f7f\u3044\u65b9<\/span><\/a>\n\n\n<h3 class=\"wp-block-heading\" id=\"i-9\">lh-template<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-json\" data-lang=\"JSON\"><code>\"lh-template\": \"lighthouse $npm_config_url --quiet --preset=desktop --chrome-flags=\\\"--headless\\\" --output json --output html --output-path .\/reports\/$npm_config_name\",<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u3001Lighthouse CLI\u306e\u5b9f\u884c\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6307\u5b9a\u3057\u3066\u308b\u5f15\u6570\u30fb\u30d1\u30e9\u30e1\u30fc\u30bf\u3054\u3068\u306b\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><span class=\"keiko_blue\"><strong>\u5f15\u6570\u30fb\u30aa\u30d7\u30b7\u30e7\u30f3<\/strong><\/span><\/td><td class=\"has-text-align-left\" data-align=\"left\"><span class=\"keiko_blue\"><strong>\u89e3\u8aac<\/strong><\/span><\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">$npm_config_url<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u30fb\u8a08\u6e2c\u5bfe\u8c61\u306eURL\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059<br>\u30fb\u5b9f\u884c\u6642\u306b<code>--url=&lt;URL&gt;<\/code>\u3068\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001<br>\u3000npm_config_url\u306b\u6307\u5b9a\u3057\u305fURL\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">\u2013quiet<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u30fb\u5b9f\u884c\u6642\u306e\u51e6\u7406\u7d4c\u904e\u7b49\u3092\u51fa\u529b\u3057\u306a\u3044\u8a2d\u5b9a\u3067\u3059<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">\u2013preset=desktop<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u30fbPC\u753b\u9762\u306e\u8a08\u6e2c\u3092\u3057\u305f\u3044\u5834\u5408\u306b\u6307\u5b9a\u3057\u307e\u3059<br>\u30fb\u30b9\u30de\u30db\u753b\u9762\u306e\u8a08\u6e2c\u306e\u5834\u5408\u306f\u672a\u6307\u5b9a\u3067OK\u3067\u3059<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">\u2013chrome-flags=\\\u201d\u2013headless\\\u201d<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u30fbchrome\u306e\u52d5\u4f5c\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059<br>\u30fb\u2013headless\u306f\u30d6\u30e9\u30a6\u30b6\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u8d77\u52d5\u3059\u308b\u8a2d\u5b9a\u3067\u3059<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">\u2013output json<br>\u2013output html<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u30fb\u51fa\u529b\u3059\u308b\u30ec\u30dd\u30fc\u30c8\u306e\u5f62\u5f0f\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059<br>\u30fb\u8907\u6570\u6307\u5b9a\u3059\u308b\u3068\u8907\u6570\u306e\u5f62\u5f0f\u3067\u30ec\u30dd\u30fc\u30c8\u304c\u51fa\u529b\u3055\u308c\u307e\u3059<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">\u2013output-path .\/reports\/$npm_config_name<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u30fb\u51fa\u529b\u3059\u308b\u30ec\u30dd\u30fc\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059<br>\u30fb<code>.reports.\u62e1\u5f35\u5b50<\/code>\u306f\u81ea\u52d5\u3067\u8a2d\u5b9a\u3055\u308c\u308b\u306e\u3067\u305d\u306e\u524d\u306e\u90e8\u5206\u3092\u6307\u5b9a\u3057\u307e\u3059<br>\u30fb\u5b9f\u884c\u6642\u306b<code>--name=&lt;\u753b\u9762\u540d&gt;<\/code>\u3068\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001<br>\u3000npm_config_name\u306b\u6307\u5b9a\u3057\u305f\u753b\u9762\u540d\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-10\">lh:yahoo \/ lh:google<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-json\" data-lang=\"JSON\"><code>\"lh:yahoo\": \"npm run lh-template --url=https:\/\/yahoo.co.jp --name=yahoo\",\n\"lh:google\": \"npm run lh-template --url=https:\/\/google.com --name=google\",<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u5148\u307b\u3069\u306elh-template\u3092\u5f15\u6570\u6307\u5b9a\u3067\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u4f5c\u308a\u3060\u3068\u3001\u8a08\u6e2c\u753b\u9762\u3092\u5897\u3084\u305d\u3046\u3068\u601d\u3063\u305f\u6642\u306b<code>url<\/code>\u3068<code>name<\/code>\u3060\u3051\u5909\u3048\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8ffd\u52a0\u3059\u308c\u3070\u3088\u3044\u3067\u3059\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">npm-run-all\u306e\u4ed5\u7d44\u307f\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u540d\u306f<code>lh:xxxx<\/code>\u306e\u5f62\u5f0f\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-11\">clean<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-json\" data-lang=\"JSON\"><code>\"clean\": \"rimraf .\/reports &amp;&amp; mkdirp .\/reports\",<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><code>rimraf<\/code>\u306fLinux\u30b3\u30de\u30f3\u30c9\u306e<code>rm<\/code>\u3092npm\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>mkdirp<\/code>\u306fLinux\u30b3\u30de\u30f3\u30c9\u306e<code>mkdir<\/code>\u3092npm\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u306e\u3067\u3001\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f<code>reports<\/code>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u307e\u3063\u3055\u3089\u306a\u72b6\u614b\u306b\u3059\u308b\u305f\u3081\u306b\u3001<br>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u524a\u9664\u3092\u4f5c\u6210\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-12\">report<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-json\" data-lang=\"JSON\"><code>\"report\": \"node src\/report.js\"<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u5f8c\u306f\u5358\u7d14\u306ajavascript\u306e\u5b9f\u884c\u3067\u3059\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-13\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306fLighthouse\u306e\u8a08\u6e2c\u3092\u81ea\u52d5\u3067\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u3093\u3067\u3082\u624b\u52d5\u3067\u3084\u308b\u3088\u308a\u3082\u30b3\u30de\u30f3\u30c9\uff11\u3064\u3067\u52dd\u624b\u306b\u3084\u3063\u3066\u304f\u308c\u305f\u65b9\u304c\u6642\u9593\u306e\u7bc0\u7d04\u306b\u306a\u3063\u3066\u3088\u3044\u3067\u3059\u3088\u306d\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3082\u3057\u300c\u4ed6\u306b\u3082\u3053\u3093\u306a\u3053\u3068\u81ea\u52d5\u5316\u3057\u305f\u3044\u3051\u3069\u3084\u308a\u65b9\u304c\u5206\u304b\u3089\u306a\u3044\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308c\u3070\u662f\u975e\u30b3\u30e1\u30f3\u30c8\u306b\u3066\u6559\u3048\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u30b5\u30a4\u30c8\u3092\u4f5c\u3063\u3066\u3044\u308b\u3068\u30da\u30fc\u30b8\u306e\u5feb\u9069\u3055\u306e\u8a08\u6e2c\u306e\u305f\u3081\u306bLighthouse\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u65b9\u306f\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002 Lighthouse\u306e\u8a08\u6e2c\u306f\u3069\u306e\u3088\u3046\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u3059\u304b\uff1f \u3088\u304f\u3042\u308b\u306e\u306fChrome\u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u65b9 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":356,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[65,66,61,32],"class_list":["post-335","post","type-post","status-publish","format-standard","has-post-thumbnail","category-6","tag-lighthouse","tag-lighthouse-cli","tag-61","tag-32"],"jetpack_featured_media_url":"https:\/\/hirabay.net\/wp-content\/uploads\/2023\/02\/8e81a5fa758618e5635518d622257bc6.png","_links":{"self":[{"href":"https:\/\/hirabay.net\/index.php?rest_route=\/wp\/v2\/posts\/335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hirabay.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hirabay.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hirabay.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hirabay.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=335"}],"version-history":[{"count":10,"href":"https:\/\/hirabay.net\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions"}],"predecessor-version":[{"id":357,"href":"https:\/\/hirabay.net\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions\/357"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hirabay.net\/index.php?rest_route=\/wp\/v2\/media\/356"}],"wp:attachment":[{"href":"https:\/\/hirabay.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hirabay.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hirabay.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}