{"id":5822,"date":"2018-07-15T10:56:26","date_gmt":"2018-07-15T01:56:26","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=5822"},"modified":"2023-05-28T00:04:07","modified_gmt":"2023-05-27T15:04:07","slug":"%e3%80%90vue-js%e3%80%91vue-cli%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%80%81%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88%e3%81%8b%e3%82%89%e3%82%b5%e3%83%b3%e3%83%97%e3%83%ab%e3%82%a2","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=5822","title":{"rendered":"\u3010Vue.js\u3011\u300cVue CLI\u300d\u3092\u4f7f\u3063\u3066\u3001webpack\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3059\u308b\u3002"},"content":{"rendered":"<p>vue-CLI\u3067\u3001webpack\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u3001Vue.js\u306e\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002<\/p>\n<p>webpack\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3082\u3057\u3042\u307e\u308a\u8a73\u3057\u304f\u306a\u3044\u3068\u3044\u3046\u65b9\u306f\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"GPcoBUma3e\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=9355\">\u3010webpack\u3011\u8a2d\u5b9a\u306e\u57fa\u672c\u3084\u300cloader(\u30ed\u30fc\u30c0\u30fc)\u300d\u306b\u3064\u3044\u3066<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=9355&#038;embed=true#?secret=GPcoBUma3e\" data-secret=\"GPcoBUma3e\" width=\"500\" height=\"282\" title=\"&#8220;\u3010webpack\u3011\u8a2d\u5b9a\u306e\u57fa\u672c\u3084\u300cloader(\u30ed\u30fc\u30c0\u30fc)\u300d\u306b\u3064\u3044\u3066&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>Node.js\u3084\u3001npm\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u304a\u308a\u3001vue-cli\u306e\u69cb\u7bc9\u304c\u7d42\u308f\u3063\u305f\u3082\u306e\u3068\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806<\/h2>\n<p>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">vue init webpack sample-app<\/pre>\n<p>\u9014\u4e2d\u3067\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u554f\u308f\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u65b9\u304c\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:default decode:true\">Install vue-router<\/pre>\n<p>ESlint\u306f\u3001\u69cb\u6587\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3063\u3066\u304f\u308c\u308b\u30c4\u30fc\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">Use ESlint to lint your code<\/pre>\n<p>\u81ea\u52d5\u30c6\u30b9\u30c8\u30c4\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u304b\u3069\u3046\u304b\u554f\u308f\u308c\u307e\u3059\u3002\u81ea\u52d5\u30c6\u30b9\u30c8\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">Set up unit test (Y\/n)<\/pre>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210<\/h2>\n<table>\n<tbody>\n<tr>\n<th>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>build<\/td>\n<td>Webpack\u306e\u30d3\u30eb\u30c9\u7528\u30b9\u30af\u30ea\u30d7\u30c8<\/td>\n<\/tr>\n<tr>\n<td>config<\/td>\n<td>Webpack\u306e\u30d3\u30eb\u30c9\u8a2d\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>dist<\/td>\n<td>\u30d3\u30eb\u30c9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u3053\u3053\u306b\u5165\u308b\u3002\u300cnpm run build\u300d\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u6642\u306b\u751f\u6210\u3055\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>src<\/td>\n<td>\u30d3\u30eb\u30c9\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5165\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u2514assets<\/td>\n<td>\u753b\u50cf\u3001\u30d5\u30a9\u30f3\u30c8\u3092\u5165\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u2514components<\/td>\n<td>\u5358\u4e00\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5165\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u2514router<\/td>\n<td>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u8a2d\u5b9a\u3092\u5165\u308c\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u2514App.vue<\/td>\n<td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c8\u306b\u306a\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/td>\n<\/tr>\n<tr>\n<td>\u2514main.js<\/td>\n<td>\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\uff08\u521d\u3081\u306b\u8aad\u307f\u8fbc\u307e\u308c\u308b\u30d5\u30a1\u30a4\u30eb\uff09<\/td>\n<\/tr>\n<tr>\n<td>static<\/td>\n<td>Loader\u3092\u4ecb\u3055\u305a\u306b\u3001\u305d\u306e\u307e\u307edist\u306b\u5165\u308b\u30d5\u30a1\u30a4\u30eb<\/td>\n<\/tr>\n<tr>\n<td>index.html<\/td>\n<td>SPA\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u306a\u308bHTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u958b\u767a\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5<\/h2>\n<p>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3001\u30a2\u30d7\u30ea\u3092dev\u30e2\u30fc\u30c9\u3067\u8d77\u52d5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">npm run dev<\/pre>\n<p>\u57fa\u672c\u306f\u3001dev\u30e2\u30fc\u30c9\u306e\u5834\u5408\u306f\u3001\u300chttp:\/\/localhost:8080\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u4e0b\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\uff29\uff30\u7d4c\u7531\u3067\u5225\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\/config\/index.js<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5831\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/IP\u7d4c\u7531\u306e\u30a2\u30af\u30bb\u30b9\u306b\u5909\u66f4.png\" alt=\"\" width=\"768\" height=\"92\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/IP\u7d4c\u7531\u306e\u30a2\u30af\u30bb\u30b9\u306b\u5909\u66f4.png 768w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/IP\u7d4c\u7531\u306e\u30a2\u30af\u30bb\u30b9\u306b\u5909\u66f4-300x36.png 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5832\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/\u30a2\u30af\u30bb\u30b9.png\" alt=\"\" width=\"625\" height=\"602\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/\u30a2\u30af\u30bb\u30b9.png 625w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/07\/\u30a2\u30af\u30bb\u30b9-300x289.png 300w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/>.<\/p>\n<h2>\u30b3\u30de\u30f3\u30c9<\/h2>\n<table>\n<tbody>\n<tr>\n<th width=\"150\">\u30b3\u30de\u30f3\u30c9<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>npm run dev<\/td>\n<td>\u958b\u767a\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>npm run build<\/td>\n<td>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u904b\u7528\u30e2\u30fc\u30c9\u3068\u3057\u3066\u5b9f\u969b\u306b\u30d3\u30eb\u30c9\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9,<span style=\"color: #ff0000;\"><strong>dist\u30d5\u30a9\u30eb\u30c0\u306b\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u304c\u3067\u304d\u308b<\/strong><\/span>\u306e\u3067\u3001\u3053\u308c\u3092\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u308a\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"vue-CLI\u3067\u3001webpack\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u3001Vue.js\u306e\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002 webpack\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3082\u3057\u3042\u307e\u308a\u8a73\u3057\u304f\u306a\u3044\u3068\u3044\u3046\u65b9\u306f\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 \u3010webpack\u3011\u8a2d\u5b9a\u306e\u57fa\u672c\u3084\u300c [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[60],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5822"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5822"}],"version-history":[{"count":18,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5822\/revisions"}],"predecessor-version":[{"id":20642,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5822\/revisions\/20642"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5822"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}