Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit af12b41

Browse files
Merge pull request #24 from cypress-io/v3
Release version 3.0 - upgrade to Babel 7
2 parents 89685c4 + ae38677 commit af12b41

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ npm install --save-dev @cypress/webpack-preprocessor
1010

1111
## Compatibility
1212

13-
This version is only compatible with webpack 4.x+. If you need webpack 2 or 3 support, use `@cypress/webpack-preprocessor` 1.x
13+
This version is only compatible with webpack 4.x+ and Babel 7.x+.
14+
15+
* If you need webpack 2 or 3 support, use `@cypress/webpack-preprocessor` 1.x
16+
* If you need Babel 6 support, use `@cypress/webpack-preprocessor` <= 2.x
1417

1518
This plugin (and all Cypress plugins) run in Cypress's own version of Node. If you require npm packages or your own code into the pluginsFile, they needs to be compatible with [the version of Node that Cypress uses]((https://github.com/cypress-io/cypress/blob/develop/.node-version)), currently `8.2.1`.
1619

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const defaultOptions = {
1919
{
2020
loader: require.resolve('babel-loader'),
2121
options: {
22-
presets: ['babel-preset-env', 'babel-preset-react'].map(require.resolve),
22+
presets: ['@babel/preset-env', '@babel/preset-react'].map(require.resolve),
2323
},
2424
},
2525
],
@@ -146,9 +146,7 @@ const preprocessor = (options = {}) => {
146146
log('watching')
147147
}
148148

149-
const bundler = file.shouldWatch
150-
? compiler.watch(watchOptions, handle)
151-
: compiler.run(handle)
149+
const bundler = file.shouldWatch ? compiler.watch(watchOptions, handle) : compiler.run(handle)
152150

153151
// when the spec or project is closed, we need to clean up the cached
154152
// bundle promise and stop the watcher via `bundler.close()`

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555
"sinon-chai": "2.13.0"
5656
},
5757
"dependencies": {
58-
"babel-core": "6.26.0",
59-
"babel-loader": "7.1.4",
60-
"babel-preset-env": "1.6.0",
61-
"babel-preset-react": "6.24.1",
58+
"@babel/core": "7.0.1",
59+
"@babel/preset-env": "7.0.0",
60+
"@babel/preset-react": "7.0.0",
61+
"babel-loader": "8.0.2",
6262
"bluebird": "3.5.0",
6363
"debug": "3.1.0",
6464
"lodash.clonedeep": "4.5.0",
65-
"webpack": "^4.0.0"
65+
"webpack": "4.18.1"
6666
},
6767
"release": {
6868
"verifyConditions": "condition-circle",

0 commit comments

Comments
 (0)