You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, Cypress comes packaged with the **Browserify Preprocessor** already installed.
23
+
By default, Cypress comes packaged with the **webpack preprocessor** already installed.
24
24
25
-
The Browserify Preprocessor handles:
25
+
The webpack preprocessor handles:
26
26
27
+
- ES2015 and JSX via Babel
28
+
- TypeScript
27
29
- CoffeeScript `1.x.x`
28
-
- ES2015 via Babel
29
-
- JSX and CJSX
30
30
- Watching and caching files
31
31
32
-
The exact default configuration options {% url 'can be found here' https://github.com/cypress-io/cypress-browserify-preprocessor#browserifyoptions %}.
33
-
34
32
{% note info %}
35
-
Are you looking to change the **default options** for Browserify?
33
+
Are you looking to change the **default options** for webpack?
36
34
{% endnote %}
37
35
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:
39
39
40
40
- Add your own Babel plugins
41
+
- Modify options for TypeScript compilation
41
42
- Add support for CoffeeScript `2.x.x`
42
43
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
-
45
44
# Usage
46
45
47
46
To use a preprocessor, you should bind to the `file:preprocessor` event in your {% url "`pluginsFile`" configuration#Folders-Files %}:
Copy file name to clipboardExpand all lines: source/faq/questions/using-cypress-faq.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -484,7 +484,7 @@ describe('Logo', () => {
484
484
485
485
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.
486
486
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.
488
488
489
489
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.
490
490
@@ -545,7 +545,7 @@ Not at the moment. {% issue 587 "There is an open issue for this." %}
545
545
546
546
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 %}.
547
547
548
-
Typically you'd reuse your existing `babel` and `webpack` configurations.
548
+
Typically you'd reuse your existing Babel and webpack configurations.
549
549
550
550
## {% fa fa-angle-right %} How does one determine what the latest version of Cypress is?
## {% fa fa-angle-right %} How do I use special characters with `cy.get()`?
630
630
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 %}.
632
632
633
633
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/ %}.
Copy file name to clipboardExpand all lines: source/guides/core-concepts/writing-and-organizing-tests.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -485,7 +485,7 @@ Set the {% url `watchForFileChanges` configuration#Global %} configuration prope
485
485
The `watchForFileChanges` property is only in effect when running Cypress using {% url "`cypress open`" command-line#cypress-open %}.
486
486
{% endnote %}
487
487
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.
489
489
490
490
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.
Copy file name to clipboardExpand all lines: source/guides/tooling/plugins-guide.md
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -34,14 +34,15 @@ Check out our {% url 'Configuration API docs' configuration-api %} which describ
34
34
35
35
## Preprocessors
36
36
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.
38
38
39
39
You can use the `file:preprocessor` event to do things like:
40
40
41
41
- Add the latest ES* support.
42
42
- 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.
45
46
46
47
Check out our {% url 'File Preprocessor API docs' preprocessors-api %} which describe how to use this event.
0 commit comments