-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pnp-webpack-plugin plugin to our default wp config
- Loading branch information
Michael Luo
committed
Jul 21, 2021
1 parent
6d3ec2d
commit 7333a7b
Showing
6 changed files
with
47 additions
and
5,545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 4 additions & 33 deletions
37
packages/server/test/support/fixtures/projects/yarn-v2-pnp/cypress/plugins/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,9 @@ | ||
const wp = require('@cypress/webpack-preprocessor') | ||
const PnpWebpackPlugin = require('pnp-webpack-plugin') | ||
|
||
const options = { | ||
webpackOptions: { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(j|t)sx?$/, | ||
use: [{ | ||
loader: require.resolve('babel-loader'), | ||
options: { | ||
presets: [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-typescript')], | ||
}, | ||
}], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.js', '.ts'], | ||
plugins: [ | ||
PnpWebpackPlugin, | ||
], | ||
}, | ||
resolveLoader: { | ||
plugins: [ | ||
PnpWebpackPlugin.moduleLoader(module), | ||
], | ||
}, | ||
|
||
}, | ||
} | ||
import * as head from 'lodash/head' | ||
|
||
// Default Cypress plugin function | ||
export default (on, config) => { | ||
on('file:preprocessor', wp(options)) | ||
// make sure plugin can access dependencies | ||
head([1, 2, 3]) | ||
|
||
return config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.