Closed hexxone closed 3 years ago
transpileOnly: true,
Did you tried to disable it? The transformer requires type information so it won't work in "transpile only" mode.
transpileOnly: true,
Did you tried to disable it? The transformer requires type information so it won't work in "transpile only" mode.
Damn, I feel stupid now. Of course this makes sense... Thanks for the tip!
I just tested this, but it still did not find the entry using ts-loader
for some reason.
So I tried again with awesome-typescript-loader
instead, and now it works like a charme!
Maybe making this one the preffered loader would be a good idea? ^^ 🤔
Anyways, tyvm 😄 nice project you have going here!
Maybe making this one the preffered loader would be a good idea? ^^ 🤔
I don't think that the loader matters here. Is it possible to create a repro for this case? If it's possible I think I can debug it to figure out what's wrong.
I don't think that the loader matters here. Is it possible to create a repro for this case? If it's possible I think I can debug it to figure out what's wrong.
Sure, I have pushed a minimal-example here: https://github.com/hexxone/ts_renamer_dbg
Thanks for taking the time if you do :) But dont stress it, since awesome-typescript-loader
works anyways ^^
Hi @hexxone,
sorry for late reply.
I finally dig into the issue and found why it is going so.
For some reason, ts-loader
uses loader.context
as a "current directory" for the compiler, which is ./src
folder (I think this path is generated by webpack itself), and it leads for the issue that when the transformer is trying to get a source file by path ./src/AudiOrbi.ts
(provided by you from the options) it fails with the error above.
It seems that there is no way to override loader.context
, so you could try to create an issue in ts-loader
repo, or as a workaround you can fix a path provided to the transformer from ./src/AudiOrbi.ts
to ./AudiOrbi.ts
(since src
is already in the path). Alternatively, you can use another loaders without such issue 🙂
Bug report
Hello there, I'm tring to set up TypeScript function minification using this lib.
However for some reason it just won't "find" the entry source files I give to it....
My setup is using webpack. See relevant configs below.
I have already tried using the following methods in most combinations:
{ options: { getCustomTransformers: program => ({ before: [ ... ] }) } }
{ loader: require.resolve('ts-loader'), options: { compiler: 'ttypescript', } }
andtsconfig.json
setup...{ loader: require.resolve('awesome-typescript-loader'), }
andtsconfig.json
setup...However, the error message always stays the same:
Error: Cannot find source file
.The weird part is, that the
.getSourceFile(...)
method definetley exists onprogram
when I do a console.log. It just does not seem to return or actually find the file.Am I missing something about the config perhaps?
Thanks in advance! I'm really at a loss with this...
tsconfig.json
webpack.config.js
Error output