diegohaz / arc

React starter kit based on Atomic Design
https://arc.js.org
2.91k stars 295 forks source link

Question about how 'components' is exported in the example project #354

Closed frednomoon closed 5 years ago

frednomoon commented 5 years ago

I have found it very interesting reading about the Atomic Design concept here, but my interest has also been picqued, by the manner in which components are being imported in the example project.

I noticed that, assuming this is not a typo or some kind of shorthard, the components folder seems to have been mapped to the components keyword so that the relative path to the folder is no longer required i.e. import { Input, Label, Field, HomePage, PageTemplate } from 'components'

Have been digging around a bit and can't understand how this is able to work, could someone please enlighten me? I cannot begin to explain how useful this will be in my other projects!

frednomoon commented 5 years ago

nvm i figured it out.... using this for anyone elses reference: https://github.com/tleunen/babel-plugin-module-resolver