Skip to content

Commit f25ce17

Browse files
authored
Merge pull request rails#41259 from gmcgibbon/webpacker_guide_code_typos
Webpacker guide code typos
2 parents 48ca9e2 + ead4fb3 commit f25ce17

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

guides/source/webpacker.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ You should choose webpacker over Sprockets on a new project if you want to use N
3636

3737
If you are familiar with Sprockets, the following guide might give you some idea of how to translate. Please note that each tool has a slightly different structure, and the concepts don't directly map onto each other.
3838

39-
|Task | Sprockets | Webpacker |
40-
|------------------|-------------------|-------------------|
41-
|Attach JavaScript |javascript_link_tag|javascript_pack_tag|
42-
|Attach CSS |stylesheet_link_tag|stylesheet_pack_tag|
43-
|Link to an image |image_url |image_pack_tag |
44-
|Link to an asset |asset_url |asset_pack_tag |
45-
|Require a script |//= require |import or require |
39+
|Task | Sprockets | Webpacker |
40+
|------------------|----------------------|-------------------|
41+
|Attach JavaScript |javascript_include_tag|javascript_pack_tag|
42+
|Attach CSS |stylesheet_link_tag |stylesheet_pack_tag|
43+
|Link to an image |image_url |image_pack_tag |
44+
|Link to an asset |asset_url |asset_pack_tag |
45+
|Require a script |//= require |import or require |
4646

4747
Installing Webpacker
4848
--------------------
@@ -51,7 +51,7 @@ To use Webpacker, you must install the Yarn package manager, version 1.x or up,
5151

5252
NOTE: Webpacker depends on NPM and Yarn. NPM, the Node package manager registry, is the primary repository for publishing and downloading open-source JavaScript projects, both for Node.js and browser runtimes. It is analogous to rubygems.org for Ruby gems. Yarn is a command-line utility that enables installation and management of JavaScript dependencies, much like Bundler does for Ruby.
5353

54-
Webpacker is installed by default in Rails 6.0 and up. In some older versions, you can install it with a new project by adding `--webpack` to the `rails new` command. In an existing project, webpacker can be added by running `bundle exec rails webpacker:install`. This installation command creates following local files:
54+
Webpacker is installed by default in Rails 6.0 and up. In some older versions, you can install it with a new project by adding `--webpack` to the `rails new` command. In an existing project, webpacker can be added by running `bin/rails webpacker:install`. This installation command creates following local files:
5555

5656
|File |Location |Explanation |
5757
|------------------------|------------------------|----------------------------------------------------------------------------------------------------|
@@ -72,17 +72,17 @@ These integrations typically install the set of NPM packages needed to get start
7272

7373
INFO. It's possible to install frameworks not included in this list. These are basic integrations of popular choices.
7474

75-
|Framework |Install command |Description |
76-
|------------------|------------------------------------|--------------------------------------------------|
77-
|Angular |`rails webpacker:install:angular` |Sets up Angular and Typescript |
78-
|CoffeeScript |`rails webpacker:install:coffee` |Sets up CoffeeScript |
79-
|Elm |`rails webpacker:install:elm` |Sets up Elm |
80-
|ERB |`rails webpacker:install:erb` |Sets up ERB support on your Javascript files |
81-
|React |`rails webpacker:install:react` |Sets up ReactJS |
82-
|Stimulus |`rails webpacker:install:stimulus` |Sets up StimulusJS |
83-
|Svelte |`rails webpacker:install:svelte` |Sets up Svelte JS |
84-
|TypeScript |`rails webpacker:install:typescript`|Sets up Typescript for your project using Babel's TypeScript support|
85-
|Vue |`rails webpacker:install:vue` |Sets up VueJS |
75+
|Framework |Install command |Description |
76+
|------------------|----------------------------------------|--------------------------------------------------|
77+
|Angular |`bin/rails webpacker:install:angular` |Sets up Angular and Typescript |
78+
|CoffeeScript |`bin/rails webpacker:install:coffee` |Sets up CoffeeScript |
79+
|Elm |`bin/rails webpacker:install:elm` |Sets up Elm |
80+
|ERB |`bin/rails webpacker:install:erb` |Sets up ERB support on your Javascript files |
81+
|React |`bin/rails webpacker:install:react` |Sets up ReactJS |
82+
|Stimulus |`bin/rails webpacker:install:stimulus` |Sets up StimulusJS |
83+
|Svelte |`bin/rails webpacker:install:svelte` |Sets up Svelte JS |
84+
|TypeScript |`bin/rails webpacker:install:typescript`|Sets up Typescript for your project using Babel's TypeScript support|
85+
|Vue |`bin/rails webpacker:install:vue` |Sets up VueJS |
8686

8787
For more information about the existing integrations, see https://github.com/rails/webpacker#integrations
8888

@@ -203,7 +203,7 @@ By default, Webpacker compiles automatically on demand in development when a Rai
203203

204204
If you want to use live code reloading, or you have enough JavaScript that on-demand compilation is too slow, you'll need to run `./bin/webpack-dev-server` or `ruby ./bin/webpack-dev-server`. This process will watch for changes in the `app/javascript/packs/*.js` files and automatically recompile and reload the browser to match.
205205

206-
Windows users will need to run these commands in a terminal separate from `bundle exec rails s`.
206+
Windows users will need to run these commands in a terminal separate from `bundle exec rails server`.
207207

208208
Once you start this development server, Webpacker will automatically start proxying all webpack asset requests to this server. When you stop the server, it'll revert to on-demand compilation.
209209

0 commit comments

Comments
 (0)