esbuild-rails 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/esbuild/version.rb +1 -1
- data/lib/install/install.rb +1 -1
- data/lib/install/package.json +1 -2
- data/lib/tasks/esbuild/compile.rake +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6981c18075254b8cf323625401fd3ac8e4823cd7c751de38b62cad747011e5a
|
4
|
+
data.tar.gz: c157fb4d1ab9390d1b687ec101ec54f2a986875912c7e57fbc1f4d7efd321916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b92bdd273cb9fbdbe188cef5ee63ed095ca051af2445caad93955e1d396c995c6b8a47a72807eda2ed49e149fc12bbf6e22e12d63b98cbc1954b005c5006b53f
|
7
|
+
data.tar.gz: 041e8bfa9e2a8008dbb39f2907ee4550fdd381ec6fd0ee2ceac2ae826c9ee1a675daecde7a0b384a6972c883230f89e126ed7f8140cf0a4612c9b90e6aae19a1
|
data/README.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
Use [esbuild](https://esbuild.github.io) to bundle your JavaScript and deliver it via the asset pipeline in Rails. This gem provides an installer to get you going with esbuild in a new Rails application, and a convention to use `app/assets/esbuilds` to hold your bundled output as artifacts that are not checked into source control (the installer adds this directory to `.gitignore` by default).
|
4
4
|
|
5
|
-
You develop using this approach by running esbuild in watch mode in a terminal with `
|
5
|
+
You develop using this approach by running esbuild in watch mode in a terminal with `yarn build --watch` (and your Rails server in another, if you're not using something like [puma-dev](https://github.com/puma/puma-dev). Whenever esbuild detects changes to any of the JavaScript files in your project, it'll bundle `app/javascript/application.js` into `app/assets/esbuilds/javascript.js`. You can refer to the build output in your layout using the standard asset pipeline approach with `<%= javascript_include_tag "application" %>`.
|
6
6
|
|
7
|
-
When you deploy your application to production, esbuild attaches to the `assets:precompile` task to ensure that all your package dependencies from `package.json` have been installed via npm, and then runs `
|
7
|
+
When you deploy your application to production, esbuild attaches to the `assets:precompile` task to ensure that all your package dependencies from `package.json` have been installed via npm, and then runs `yarn build` to process `app/javascript/application.js` into `app/assets/esbuilds/javascript.js`. The latter file is then picked up by the asset pipeline, digested, and copied into public/assets, as any other asset pipeline file.
|
8
8
|
|
9
9
|
That's it!
|
10
10
|
|
@@ -13,7 +13,7 @@ You can tailor the configuration of esbuild through the build script in `package
|
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
16
|
-
You must already have node and
|
16
|
+
You must already have node and yarn installed on your system. Then:
|
17
17
|
|
18
18
|
1. Add `esbuild-rails` to your Gemfile with `gem 'esbuild-rails'`
|
19
19
|
2. Run `./bin/bundle install`
|
data/lib/esbuild/version.rb
CHANGED
data/lib/install/install.rb
CHANGED
data/lib/install/package.json
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
"name": "myapp",
|
3
3
|
"private": "true",
|
4
4
|
"scripts": {
|
5
|
-
"build": "esbuild app/javascript/application.js --outfile=app/assets/esbuilds/application.js --bundle"
|
6
|
-
"watch": "npm run build -- --watch"
|
5
|
+
"build": "esbuild app/javascript/application.js --outfile=app/assets/esbuilds/application.js --bundle"
|
7
6
|
}
|
8
7
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esbuild-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|