Document Support for Esbuild
See original GitHub issueRails 7 seems to be moving away from webpack(er), with multiple options to bundle JS with the new js-bundling
gem (e.g. with ESbuild etc.).
As such, in order to future proof the project, it might make sense to add support/documentation for JS bundling solutions other than webpack.
Notably, require.context()
is webpack specific. I have managed to work around this by providing a mapping manually with ESbuild:
var ReactRailsUJS = require('react_ujs');
ReactRailsUJS.useContext({
Table: require('./components/Table'),
});
As such, simply removing require.context()
meant that I was able to successfully use react-rails with ESbuild.
This took quite some time to work out - as such, it would be useful to document this (or a better solution) somewhere.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:10
- Comments:21
Top Results From Across the Web
API - esbuild
Sources content; Supported; Tree shaking; Tsconfig raw. #Build API. The build API call operates on one or more files in the file system....
Read more >Getting started with esbuild - LogRocket Blog
... CSS, and image files in this comprehensive esbuild tutorial. ... supports for React, CSS, and images, but it doesn't support SASS.
Read more >AWS SAM CLI esbuild support is now generally available
To learn more about this feature, please read details in the documentation. To get started, you can install the SAM CLI by following...
Read more >esbuild - npm
esbuild. This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the JavaScript API documentation for details.
Read more >Introduction to esbuild - Telerik
We're going to cover what exactly esbuild is and how it can help us to ... Initially, JavaScript applications were simply single files...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this one working fine with me
I made a guide based on @cionescu’s repo. I will try to make a PR with updated generators and README.