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

webpack use mini-css-extract-plugin with esbuild-loader has error #16

Closed
zhusjfaker opened this issue Aug 5, 2020 · 2 comments · Fixed by #17
Closed

webpack use mini-css-extract-plugin with esbuild-loader has error #16

zhusjfaker opened this issue Aug 5, 2020 · 2 comments · Fixed by #17
Labels

Comments

@zhusjfaker
Copy link
Contributor

repo:
https://github.com/zhusjfaker/esbuild-demo
branch:
master
command:
npm run csr

I have already add the EsbuldPlugin in my webpack-config

image

image

if remove the "MiniCssExtractPlugin.loader" u will compile success

error pic:

image

@zhusjfaker
Copy link
Contributor Author

@happybang help

https://github.com/happybang

compiler.hooks.thisCompilation.tap('esbuild',(compilation)=>{
      compilation.hooks.childCompiler.tap('esbuild', (childCompiler, _compilerName, _compilerIndex) => {
        childCompiler.$esbuildService = compiler.$esbuildService;
      });
    })

image

zhusjfaker added a commit to zhusjfaker/esbuild-loader that referenced this issue Aug 5, 2020
…hildcompiler in webpack For example, mini CSS extract plugin

Among the common plugins in webpack, many plugins create child-compiler to build their own chunks.
However, the value of $esbuildservice is not correctly assigned, which causes errors in the
compilation of webpack on the child-compiler,For example, mini CSS extract plugin

Closes privatenumber#16
egoist added a commit that referenced this issue Aug 5, 2020
…hildcompiler in webpack (#17)

* fix: Fix the problem that esbuild service cannot be detected due to childcompiler in webpack For example, mini CSS extract plugin

Among the common plugins in webpack, many plugins create child-compiler to build their own chunks.
However, the value of $esbuildservice is not correctly assigned, which causes errors in the
compilation of webpack on the child-compiler,For example, mini CSS extract plugin

Closes #16

* tweaks

Co-authored-by: zhushijie.jayson <zhushijie.jayson@bytedance.com>
Co-authored-by: Kevin Titor <0x142857@gmail.com>
@github-actions
Copy link

github-actions bot commented Aug 5, 2020

🎉 This issue has been resolved in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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