jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.22k stars 507 forks source link

support for assets in Parcel example app #994

Closed y-nk closed 1 year ago

y-nk commented 3 years ago

Current Behavior

In a tsdx react/storybook project, you may want to add fonts or images with your components. With the proper loader as explained here, you can easily include your assets. For fonts, you can "tree shake" the inclusion with imports, like import RegularFont from 'regularFont.ttf', build along a @font-face css block with url(${regularFont}) and it will compile nicely.

The problem is that the example app works with parcel and so assets aren't shipped. I expect this will be a similar issue with npm link workflow for working in tandem with other projects.

Expected behavior

Static assets should be loaded as well im example app.

Suggested solution(s)

Not sure.

Additional context

I reckon is this side effect of tsdx and not really a direct issue of the package, but... yeah. I think a lot of people would definitely be interested in an answer/solution.

Your environment

  System:
    OS: macOS 11.2.3
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 385.52 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.0.1 - ~/.nvm/versions/node/v15.0.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.10 - ~/.nvm/versions/node/v15.0.1/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
    Firefox: 84.0.1
    Safari: 14.0.3
  npmPackages:
    tsdx: ^0.14.1 => 0.14.1
    typescript: ^4.2.3 => 4.2.3