Skip to content

Commit 4bbb59c

Browse files
authored
Merge pull request rails#49028 from akhilgkrishnan/move-sh-to-bash
[skip ci] Moved sh to bash and added missing $
2 parents a6f8624 + 0f7f9e3 commit 4bbb59c

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

guides/source/asset_pipeline.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,18 @@ All of the configured import maps should be attached in `<head>` element of your
155155
156156
### Using npm packages via JavaScript CDNs
157157
158-
You can use the `./bin/importmap` command that's added as part of the `importmap-rails` install to pin, unpin, or update npm packages in your import map. The binstub uses [`JSPM.org`](https://jspm.org/).
158+
You can use the `bin/importmap` command that's added as part of the `importmap-rails` install to pin, unpin, or update npm packages in your import map. The binstub uses [`JSPM.org`](https://jspm.org/).
159159
160160
It works like so:
161161
162-
```sh
163-
./bin/importmap pin react react-dom
162+
```bash
163+
$ bin/importmap pin react react-dom
164164
Pinning "react" to https://ga.jspm.io/npm:[email protected]/index.js
165165
Pinning "react-dom" to https://ga.jspm.io/npm:[email protected]/index.js
166166
Pinning "object-assign" to https://ga.jspm.io/npm:[email protected]/index.js
167167
Pinning "scheduler" to https://ga.jspm.io/npm:[email protected]/index.js
168168
169-
./bin/importmap json
169+
bin/importmap json
170170
171171
{
172172
"imports": {
@@ -190,38 +190,38 @@ import ReactDOM from "react-dom"
190190
191191
You can also designate a specific version to pin:
192192
193-
```sh
194-
./bin/importmap pin react@17.0.1
193+
```bash
194+
$ bin/importmap pin react@17.0.1
195195
Pinning "react" to https://ga.jspm.io/npm:[email protected]/index.js
196196
Pinning "object-assign" to https://ga.jspm.io/npm:[email protected]/index.js
197197
```
198198
199199
Or even remove pins:
200200
201-
```sh
202-
./bin/importmap unpin react
201+
```bash
202+
$ bin/importmap unpin react
203203
Unpinning "react"
204204
Unpinning "object-assign"
205205
```
206206
207207
You can control the environment of the package for packages with separate "production" (the default) and "development" builds:
208208
209-
```sh
210-
./bin/importmap pin react --env development
209+
```bash
210+
$ bin/importmap pin react --env development
211211
Pinning "react" to https://ga.jspm.io/npm:[email protected]/dev.index.js
212212
Pinning "object-assign" to https://ga.jspm.io/npm:[email protected]/index.js
213213
```
214214
215215
You can also pick an alternative, supported CDN provider when pinning, like [`unpkg`](https://unpkg.com/) or [`jsdelivr`](https://www.jsdelivr.com/) ([`jspm`](https://jspm.org/) is the default):
216216
217-
```sh
218-
./bin/importmap pin react --from jsdelivr
217+
```bash
218+
$ bin/importmap pin react --from jsdelivr
219219
Pinning "react" to https://cdn.jsdelivr.net/npm/[email protected]/index.js
220220
```
221221
222222
Remember, though, that if you switch a pin from one provider to another, you may have to clean up dependencies added by the first provider that isn't used by the second provider.
223223
224-
Run `./bin/importmap` to see all options.
224+
Run `bin/importmap` to see all options.
225225
226226
Note that this command is merely a convenience wrapper to resolving logical package names to CDN URLs. You can also just lookup the CDN URLs yourself, and then pin those. For example, if you wanted to use Skypack for React, you could just add the following to `config/importmap.rb`:
227227

railties/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@
703703
704704
Previously, when running this command:
705705
706-
``` sh
707-
bin/rails generate scaffold_controller Admin/Post --model-name Post
706+
```bash
707+
$ bin/rails generate scaffold_controller Admin/Post --model-name Post
708708
```
709709
710710
the comments above the controller action would look like:

0 commit comments

Comments
 (0)