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

Commit 22db72d

Browse files
Merge pull request #36 from paulfalgout/patch-2
major: Move external resources to peerDependencies
2 parents ce78a17 + dd3678e commit 22db72d

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,22 @@ Cypress preprocessor for bundling JavaScript via webpack
88
npm install --save-dev @cypress/webpack-preprocessor
99
```
1010

11+
This package relies on the following [peer dependencies](https://docs.npmjs.com/files/package.json#peerdependencies):
12+
13+
* @babel/core
14+
* @babel/preset-env
15+
* babel-loader
16+
* webpack
17+
18+
It is likely you already have these installed either directly or as a transient dependency, but if not, you will need to install them.
19+
20+
```sh
21+
npm install --save-dev @babel/core @babel/preset-env babel-loader webpack
22+
```
23+
1124
## Compatibility
1225

13-
This version is only compatible with webpack 4.x+ and Babel 7.x+.
26+
This version is only compatible with webpack 4.x+ and Babel 7.x+.
1427

1528
* If you need webpack 2 or 3 support, use `@cypress/webpack-preprocessor` 1.x
1629
* If you need Babel 6 support, use `@cypress/webpack-preprocessor` <= 2.x
@@ -63,10 +76,7 @@ Object of webpack options. Just `require` in the options from your `webpack.conf
6376
use: [{
6477
loader: 'babel-loader',
6578
options: {
66-
presets: [
67-
'babel-preset-env',
68-
'babel-preset-react',
69-
],
79+
presets: ['babel-preset-env'],
7080
},
7181
}],
7282
},

index.js

Lines changed: 1 addition & 1 deletion
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: require.resolve('@babel/preset-env'),
2323
},
2424
},
2525
],

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,16 @@
5454
"sinon": "3.2.1",
5555
"sinon-chai": "2.13.0"
5656
},
57+
"peerDependencies": {
58+
"@babel/core": "^7.0.1",
59+
"@babel/preset-env": "^7.0.0",
60+
"babel-loader": "^8.0.2",
61+
"webpack": "^4.18.1"
62+
},
5763
"dependencies": {
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",
6264
"bluebird": "3.5.0",
6365
"debug": "3.1.0",
64-
"lodash.clonedeep": "4.5.0",
65-
"webpack": "4.18.1"
66+
"lodash.clonedeep": "4.5.0"
6667
},
6768
"release": {
6869
"verifyConditions": "condition-circle",

0 commit comments

Comments
 (0)