Skip to content

Commit 355a90b

Browse files
Update default preprocessor references from browserify to webpack (#3015)
Co-authored-by: Jennifer Shehane <[email protected]>
1 parent 4568eb4 commit 355a90b

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

source/_changelogs/1.1.2.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
- {% url 'Added ESLint, Docker, and TypeScript to Plugins' plugins %}
1313
- {% url 'Added recipe for TypeScript with Browserify' recipes %}
14-
- {% url 'Added recipe for TypeScript with Webpack' recipes %}
14+
- {% url 'Added recipe for TypeScript with webpack' recipes %}
1515
- {% url 'Added recipe for Direct Controlling AngularJS' recipes %}
1616
- {% url 'Added recipe for E2E API Testing' recipes %}
1717
- {% url 'Added more video tutorials' tutorials %}
1818
- {% url 'Improved displaying list of Tutorials, Recipes, Applications, and Docker examples' recipes %}
19-

source/api/plugins/preprocessors-api.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,33 @@ We've created three preprocessors as examples for you to look at. These are full
1414

1515
The code contains comments that explain how it utilizes the preprocessor API.
1616

17-
* {% url 'Browserify Preprocessor' https://github.com/cypress-io/cypress-browserify-preprocessor %}
18-
* {% url 'webpack Preprocessor' https://github.com/cypress-io/cypress-webpack-preprocessor %}
19-
* {% url 'Watch Preprocessor' https://github.com/cypress-io/cypress-watch-preprocessor %}
17+
* {% url 'webpack preprocessor' https://github.com/cypress-io/cypress-webpack-preprocessor %}
18+
* {% url 'Browserify preprocessor' https://github.com/cypress-io/cypress-browserify-preprocessor %}
19+
* {% url 'Watch preprocessor' https://github.com/cypress-io/cypress-watch-preprocessor %}
2020

2121
# Defaults
2222

23-
By default, Cypress comes packaged with the **Browserify Preprocessor** already installed.
23+
By default, Cypress comes packaged with the **webpack preprocessor** already installed.
2424

25-
The Browserify Preprocessor handles:
25+
The webpack preprocessor handles:
2626

27+
- ES2015 and JSX via Babel
28+
- TypeScript
2729
- CoffeeScript `1.x.x`
28-
- ES2015 via Babel
29-
- JSX and CJSX
3030
- Watching and caching files
3131

32-
The exact default configuration options {% url 'can be found here' https://github.com/cypress-io/cypress-browserify-preprocessor#browserifyoptions %}.
33-
3432
{% note info %}
35-
Are you looking to change the **default options** for Browserify?
33+
Are you looking to change the **default options** for webpack?
3634
{% endnote %}
3735

38-
Changing the Browserify options lets you:
36+
If you already use webpack in your project, you can pass in your webpack config as {% url 'shown here' https://github.com/cypress-io/cypress-webpack-preprocessor#options %}.
37+
38+
If you don't use webpack in your project or would like to keep the majority of the default options, you can {% url 'modify the default options' https://github.com/cypress-io/cypress-webpack-preprocessor#modifying-default-options %}. Editing the options allows you to do things like:
3939

4040
- Add your own Babel plugins
41+
- Modify options for TypeScript compilation
4142
- Add support for CoffeeScript `2.x.x`
4243

43-
Please read this link in the {% url 'Browserify preprocessor' https://github.com/cypress-io/cypress-browserify-preprocessor#modifying-default-options %} repo for instructions on modifying these.
44-
4544
# Usage
4645

4746
To use a preprocessor, you should bind to the `file:preprocessor` event in your {% url "`pluginsFile`" configuration#Folders-Files %}:

source/faq/questions/using-cypress-faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ describe('Logo', () => {
484484

485485
The code you write in Cypress is executed in the browser, so you can import or require JS modules, *but* only those that work in a browser.
486486

487-
You can `require` or `import` them as you're accustomed to. We preprocess your spec files with `babel` and `browserify`.
487+
You can `require` or `import` them as you're accustomed to. We preprocess your spec files with webpack and Babel.
488488

489489
We recommend utilizing one of the following to execute code outside of the browser. Furthermore, you can use your own Node version during code excecution by setting the {% url "`nodeVersion`" configuration#Node-version %} in your configuration.
490490

@@ -545,7 +545,7 @@ Not at the moment. {% issue 587 "There is an open issue for this." %}
545545

546546
Yes. You can customize how specs are processed by using one of our {% url 'preprocessor plugins' plugins %} or by {% url 'writing your own custom preprocessor' preprocessors-api %}.
547547

548-
Typically you'd reuse your existing `babel` and `webpack` configurations.
548+
Typically you'd reuse your existing Babel and webpack configurations.
549549

550550
## {% fa fa-angle-right %} How does one determine what the latest version of Cypress is?
551551

@@ -628,7 +628,7 @@ Also, check out our {% url 'Stubbing `console` Receipe' recipes#Stubbing-and-spy
628628

629629
## {% fa fa-angle-right %} How do I use special characters with `cy.get()`?
630630

631-
Special characters like `/`, `.` are valid characters for ids {% url "according to the CSS spec" https://www.w3.org/TR/html50/dom.html#the-id-attribute %}.
631+
Special characters like `/`, `.` are valid characters for ids {% url "according to the CSS spec" https://www.w3.org/TR/html50/dom.html#the-id-attribute %}.
632632

633633
To test elements with those characters in ids, they need to be escaped with {% url "`CSS.escape`" https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape %} or {% url "`Cypress.$.escapeSelector`" https://api.jquery.com/jQuery.escapeSelector/ %}.
634634

source/guides/core-concepts/writing-and-organizing-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ Set the {% url `watchForFileChanges` configuration#Global %} configuration prope
485485
The `watchForFileChanges` property is only in effect when running Cypress using {% url "`cypress open`" command-line#cypress-open %}.
486486
{% endnote %}
487487

488-
The component responsible for the file-watching behavior in Cypress is the {% url 'Cypress Browserify Preprocessor' https://github.com/cypress-io/cypress-browserify-preprocessor %}. This is the default file-watcher packaged with Cypress.
488+
The component responsible for the file-watching behavior in Cypress is the {% url '`cypress-webpack-preprocessor`' https://github.com/cypress-io/cypress-webpack-preprocessor %}. This is the default file-watcher packaged with Cypress.
489489

490490
If you need further control of the file-watching behavior you can configure this preprocessor explicitly: it exposes options that allow you to configure behavior such as _what_ is watched and the delay before emitting an "update" event after a change.
491491

source/guides/tooling/plugins-guide.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ Check out our {% url 'Configuration API docs' configuration-api %} which describ
3434

3535
## Preprocessors
3636

37-
The event `file:preprocessor` is used to customize how your test code is transpiled and sent to the browser. By default Cypress handles CoffeeScript and ES6 using `babel` and then uses `browserify` to package it for the browser.
37+
The event `file:preprocessor` is used to customize how your test code is transpiled and sent to the browser. By default, Cypress handles ES2105, TypeScript, and CoffeeScript, using webpack to package it for the browser.
3838

3939
You can use the `file:preprocessor` event to do things like:
4040

4141
- Add the latest ES* support.
4242
- Write your test code in ClojureScript.
43-
- Customize the `babel` settings to add your own plugins.
44-
- Swap out `browserify` for `webpack` or anything else.
43+
- Customize the Babel settings to add your own plugins.
44+
- Customize the options for compiling TypeScript.
45+
- Swap out webpack for Browserify or anything else.
4546

4647
Check out our {% url 'File Preprocessor API docs' preprocessors-api %} which describe how to use this event.
4748

0 commit comments

Comments
 (0)