-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Timeout with codesplitting #2637
Comments
I guess you have to disable the |
@hyrious thank you so much, that did it:
Not really sure how to have it enabled during development without updating
|
You can use environment variables for this. For example |
That is really helpful, thank you @evanw I discovered it is possible to const path = require('path');
console.log("NODE_ENV: " + process.env.NODE_ENV);
console.log("CI: " + process.env.CI);
console.log(!(process.env.NODE_ENV === 'production' || process.env.CI));
require("esbuild").build({
entryPoints: ["stimulus.js","article.js"],
bundle: true,
minify: true,
outdir: path.join(process.cwd(), "app/assets/builds"),
absWorkingDir: path.join(process.cwd(), "app/javascript"),
watch: !(process.env.NODE_ENV === 'production' || process.env.CI),
loader: { '.js': 'jsx' },
publicPath: 'assets',
target: 'es6',
// custom plugins will be inserted is this array
plugins: [],
}).catch(() => process.exit(1)); |
I'm unable to see the output for this. I get no confirmation or error when something is broken within the build. So In fact, nothing is being "watched". I seemed to have fixed that by adding this to watch:
This gives me a live response in the terminal for success as:
and for failure of code
Sourced from: #805 (comment) package.json
entire esbuild.config.js
|
You may be interested in this setting: https://esbuild.github.io/api/#log-level. Specifically |
Using esbuild with a Rails 7 app, I've been successful in code splitting 2 packages: one with the StimulusJS controllers and another with a ReactJS app. The configuration works fine in development.
When pushed to the CI (GitHub Actions) or pushed directly to Heroku, it times out.
package.json
app/assets/config/esbuild.js
GitHub Actions
Heroku
Hangs on this step
Also asked here https://stackoverflow.com/questions/74217342/esbuild-timeout-with-codesplitting
The text was updated successfully, but these errors were encountered: