-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Why is it still using Webpack, or is it broken? #23
Comments
I think it's because of this:
privatenumber/esbuild-loader#125 I asked them to explain further but they didn't provide any useful information, only what I had already read. Digging further into this, I think this is the issue, due to changes in ESBuild v0.9.0 (https://github.com/evanw/esbuild/releases/tag/v0.9.0):
|
Is there any cure for this? Also use craco esbuild and the build time remais the same. |
For small build (like 5s) you won't see any difference as the biggest part of that time is actually used by webpack. This project is still using webpack along with esbuild, babel is replaced by esbuild but the bundling is still handled by webpack. |
@pradel -- I'm not seeing that ESBulid is being utilized at all after the changes I linked above. We utilize CRA in several extremely large production projects and after I attempted to implement this plugin I simply receive the following:
And see no improvement in transpilation. |
@cjones26 okay that's not normal in that case yeah. The warning you had was fixed in the latest version so maybe you can give it another try? |
I'm actually seeing the same thing as @cjones26 with a config as below, the craco build is the same output and time taken as when I run react-scripts build const CracoEsbuildPlugin = require('craco-esbuild')
let path = require('path')
module.exports = {
plugins: [
{
plugin: CracoEsbuildPlugin,
options: {
includePaths: [
path.resolve('src'),
path.resolve(__dirname, '..', '..', 'design-system'),
],
enableSvgr: true, // Optional.
esbuildLoaderOptions: {
loader: 'jsx',
target: 'es2015',
},
},
},
],
} |
Same here. Tested a few times, didn't see much difference, both took over 2 minutes to complete |
You can compare before and after with the // craco.config.js
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const CracoEsbuildPlugin = require("craco-esbuild");
const smp = new SpeedMeasurePlugin();
module.exports = {
plugins: [{ plugin: CracoEsbuildPlugin }], // <-- comment this line to see w/o esbuild
webpack: {
configure: (webpackConfig) => smp.wrap(webpackConfig),
},
// eslint: { enable: false, }, // <-- this shaves a couple of seconds for me
}; In a small-ish project I'm trying it shaves 50% of the build time (39sec -> 20sec) |
@withinoneyear @neil-buckley @cjones26 Have you find any work around for that? I'm in the same situation as you where I see no big difference between craco es-build vs CRA. |
I first tested in a much more evolved but still CRA based with TypeScript project. Didn't seem to be using esbuild. The
yarn build
still took ~10s.Start a fresh new project:
Then I followed the steps in the readme verbatim. And when I type
yarn build
you can see that it's supposedly usingcraco
:But still takes about ~5s to build. I don't know what I'm doing but I did open
node_modules/react-scripts/scripts/build.js
and with some scatterconsole.log
it seems it's still usingwebpack
.Is it busted at the moment? Or is something missing in the readme?
The text was updated successfully, but these errors were encountered: