visual studio code - Tell the TypeScript compiler where to look for non-relative modules -
i'm using ts-loader , webpack compile .ts files. in webpack config have following configuration:
resolve: { modulesdirectories: ['shared', 'node_modules'] }
this allows me import component lives in shared directory without spelling out full relative path. example: import button 'components/button'
webpack walk directory tree looking shared
directory. way, component can live in ../../shared/components/buttton.tsx
, webpack find , bundle it.
this works fine, getting errors in editors (both sublime , vs code). also, if run tsc
command command line compiler errors because ts compiler not know how resolve modules.
is there way tell ts compiler recursively component in shared
directories?
i using ts 2.1v
i noticed new baseurl
, paths
configuration options not able use them successfully.
is there way tell ts compiler recursively component in shared directories
not recursively. can go 1 level using paths
mapping.
Comments
Post a Comment