{"id":488,"date":"2018-10-01T10:19:43","date_gmt":"2018-10-01T01:19:43","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2018\/10\/01\/assets-for-nuxt-storybook"},"modified":"2018-10-01T10:19:43","modified_gmt":"2018-10-01T01:19:43","slug":"assets-for-nuxt-storybook","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2018\/10\/01\/assets-for-nuxt-storybook\/","title":{"rendered":"Nuxt.js\u30a2\u30d7\u30ea\u306eStorybook\u3067\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3080"},"content":{"rendered":"
Nuxt.js\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306eStorybook\u3067\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3080\u5c0f\u30cd\u30bf\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n
Storybook\u3067\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306f\u3001 Nuxt.js\u3060\u3068 \u305f\u3060\u3057\u3001Nuxt.js\u5185\u3067\u3001\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u308b\u5834\u5408\u3001Storybook\u4e0a\u3067\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n \u3053\u308c\u306f\u3001\u30d3\u30eb\u30c9\u3055\u308c\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f \u3053\u308c\u3092resolve.alias\u306b\u624b\u3092\u52a0\u3048\u305a\u3001\u30b9\u30de\u30fc\u30c8\u306b\u89e3\u6c7a\u3067\u304d\u306a\u3044\u304b\u3068\u8003\u3048\u307e\u3057\u305f\u3002<\/p>\n \u89e3\u6c7a\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059(\u3068\u3044\u3063\u3066\u3082\u7c21\u5358\u3067\u3059\u304c\u2026)\u3002<\/p>\n \u307e\u305a \u6b21\u306b\u3001Storybook\u306e \u3053\u308c\u306b\u3088\u308a\u3001Storybook\u3067\u3082\u3001 Nuxt.js\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306eStorybook\u3067\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3080\u5c0f\u30cd\u30bf\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u554f\u984c Storybook\u3067\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306f\u3001-s\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 Nuxt.js\u3060\u3068assets\u914d\u4e0b\u306b\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u3001Storybook\u3067assets\u914d\u4e0b\u304c\u30db\u30b9\u30c8\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 { "scripts": { "start […]<\/p>\n","protected":false},"author":1,"featured_media":826,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/488"}],"collection":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/comments?post=488"}],"version-history":[{"count":0,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/488\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/media\/826"}],"wp:attachment":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/media?parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/categories?post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/tags?post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}-s<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n
assets<\/code>\u914d\u4e0b\u306b\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u3001Storybook\u3067
assets<\/code>\u914d\u4e0b\u304c\u30db\u30b9\u30c8\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n
{\n "scripts": {\n "start-storybook": "start-storybook -s .\/assets -p 6006"\n }\n}<\/code><\/pre>\n
.background {\n background: url('~\/assets\/images\/sample.png') no-repeat;\n}<\/code><\/pre>\n
http:\/\/localhost:3000\/assets\/images\/sample.png<\/code>\u304b\u3089\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3082\u3046\u3068\u3057\u307e\u3059\u304c\u3001Storybook\u3067\u306f\u3001
http:\/\/localhost:3000\/images\/sample.png<\/code>\u3067\u753b\u50cf\u3092\u30db\u30b9\u30c8\u3057\u3066\u3044\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n
\u89e3\u6c7a\u6cd5<\/h2>\n
assets-link<\/code>\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b
assets<\/code>\u3078\u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u306f\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n
mkdir assets-link\nln -s ..\/assets assets-link\/assets<\/code><\/pre>\n
-s<\/code>\u306b\u308f\u305f\u3059\u5024\u3092
assets-link<\/code>\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n
{\n "scripts": {\n "start-storybook": "start-storybook -s .\/assets-link -p 6006"\n }\n}<\/code><\/pre>\n
http:\/\/localhost:3000\/assets\/images\/sample.png<\/code>\u3067\u753b\u50cf\u3092\u30db\u30b9\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3082\u624b\u3092\u52a0\u3048\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f(\u00b4\u03c9` )<\/p>\n","protected":false},"excerpt":{"rendered":"