Storybook: ์ ˆ๋Œ€ ๊ฒฝ๋กœ ๋ฌธ์ œ

์— ๋งŒ๋“  2016๋…„ 07์›” 25์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: storybookjs/storybook

์ด๊ฒƒ์€ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค

import Component from '../component.jsx';

์˜ค๋ฅ˜ ๋ฐœ์ƒ

import Component from '/client/modules/account_details/components/component.jsx';

Module not found: Error: Cannot resolve 'file' or 'directory'

๋‚ด ๊ตฌ์„ฑ ์š”์†Œ ์ค‘ ์ผ๋ถ€์—๋Š” import ๋ฌธ์— ์ ˆ๋Œ€ ๊ฒฝ๋กœ๊ฐ€ ์žˆ์œผ๋ฉฐ ์ด๋กœ ์ธํ•ด ์ด์•ผ๊ธฐ๊ฐ€ ์ค‘๋‹จ๋ฉ๋‹ˆ๋‹ค. ../../../../ ๋“ฑ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒƒ ์™ธ์— ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๊นŒ?

https://github.com/mantrajs/babel-root-slash-import๋ฅผ ์‚ฌ์šฉํ•ด ๋ณด์•˜์ง€๋งŒ
ํ•ด๋‹น ํŒจํ‚ค์ง€์™€ .babelrc ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•œ ํ›„ Uncaught SyntaxError: Unexpected token import ๋ฌธ์ œ

{
  "plugins": [
    "babel-root-slash-import"
  ]
}

๋ชจ๋“  3 ๋Œ“๊ธ€

๋กœ ์ด๊ฒƒ์„ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค

{
  "presets": ["es2015", "react"],
  "plugins": [
    "babel-root-slash-import"
  ]
}
{
    "presets": ["es2015", "react"],
    "plugins": [
        [
            "babel-root-slash-import", {
                "rootPathSuffix": "src/"
            }
        ]
    ]
  }

์ด ๊ฐ™์€?
์ด๊ฒƒ์€ ์ž‘๋™ํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์—

๋˜ํ•œ ์ด๊ฒƒ์€ ๋ฐ˜์‘ ์•ฑ ์ƒ์„ฑ์—์„œ .babelrc์˜ ๊ธฐ๋ณธ ๊ตฌ์„ฑ์„ ์žฌ์ •์˜ํ•ฉ๋‹ˆ๊นŒ?

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰