Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Need clarification regarding the first two rules #207

Open
2 of 4 tasks
nyngwang opened this issue Mar 14, 2024 · 3 comments
Open
2 of 4 tasks

README: Need clarification regarding the first two rules #207

nyngwang opened this issue Mar 14, 2024 · 3 comments

Comments

@nyngwang
Copy link

nyngwang commented Mar 14, 2024

Documentation Is:

  • Missing
  • Needed
  • Confusing
  • Not Sure?

Please Explain in Detail...

There are some caveats listed in README.md. Specifically, my concern around it is the first rule and the third rule:

Loaders running in a worker pool are limited. Examples:

Loaders cannot emit files.
Loaders cannot use custom loader API (i. e. by plugins).
Loaders cannot access the webpack options.

Confusion on Rule 1

Isn't that babel-loader also emitting files for webpack eventually? In the example given in the readme, it mentioned that it is expected to work with babel-loader. I need some clarifications here as I have some misunderstandings.

Confusion on Rule 3

In my case, I'm using babel-loader with some custom options like rootMode: 'upward', and in my babel.config.js I also included some third-party plugins like react-refresh/babel for HMR with the corresponding plugin in my webpack.config.js. Does this rule mean that babel-loader could not access these plugins?

Your Proposal for Changes

No. I just need some clarification.

@nyngwang
Copy link
Author

nyngwang commented Mar 14, 2024

@ersachin3112 @alexander-akait Could you please help? I want to know whether or not thread-loader would read my options of babel-loader in webpack.config.js. Thank you.

@nyngwang
Copy link
Author

I tried thread-loader anyway regardless of its correctness as mentioned above. In the end, it increased my time of compilation. I did try warmup and all kinds of combinations with the settings. The results are all the same: slower.

@alexander-akait
Copy link
Member

Yes, it will be faster only for really big projects, because a creation of threads are very expensive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants