Skip to content

Commit 928868e

Browse files
authored
Note the esbuild application.css conflict
1 parent 95e6b15 commit 928868e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ We're working on a path to bring source-map compatibility to the webpack path, a
4040

4141
The default build script for esbuild relies on the `app/javascript/*.*` glob pattern to compile multiple entrypoints automatically. This glob pattern is not available by default on Windows, so you need to change the build script in `package.json` to manually list the entrypoints you wish to compile.
4242

43+
## Why does esbuild overwrite my application.css?
44+
45+
If you [import CSS](https://esbuild.github.io/content-types/#css-from-js) in your application.js while using esbuild, you'll be creating both an `app/assets/builds/application.js` _and_ `app/assets/builds/application.css` file when bundling. The latter can conflict with the `app/assets/builds/application.js` produced by [cssbundling-rails](https://github.com/rails/cssbundling-rails). The solution is to either change the output file for esbuild (and the references for that) or for cssbundling. Both are specified in `package.json`.
46+
47+
4348
## License
4449

4550
JavaScript Bundling for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)