jaredpalmer / tsdx

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

How do I get it to work with "@import" #827

Closed jauggy closed 4 years ago

jauggy commented 4 years ago

I get the error:

Module parse failed: Unexpected character '@' (9:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
agilgur5 commented 4 years ago

Please don't remove the issue template, it's there for a reason and would have been quite useful here...

Your error is coming from Webpack, which is not part of TSDX, so I have no idea how or if this is even related from so few details.

@import is also CSS syntax, not TS/JS. TSDX does not touch CSS on its own either, you must add a Rollup plugin for something like that

Without significantly more details, this seems like an invalid issue in the wrong repo

jauggy commented 4 years ago

I'll do more investigation and try adding Rollup plugin.

I was confused what issue template to use since it is neither a bug report nor a feature request (the two templates you have). It's simply a question.

Thanks for your help anyway.

agilgur5 commented 4 years ago

I'll do more investigation and try adding Rollup plugin.

Ok I mean I still have absolutely no idea what the problem is because you didn't provide a reproduction and your error is from Webpack, not TSDX or Rollup. I was just writing how things generally work

I was confused what issue template to use since it is neither a bug report nor a feature request (the two templates you have). It's simply a question.

You listed an error message so I would think you were filing a bug report. But that error is not from TSDX, it's from Webpack.

If you had a pure question I would suggest looking at the docs, StackOverflow, etc first. If none are sufficient then could file a request to improve the docs regarding the topic of your question. But ideally we'd want to direct questions and support to StackOverflow or GitHub Discussions (which I don't think is generally available yet) as opposed to issues which are mainly for bugs and features.