Skip to content

Commit eb520a0

Browse files
committed
chore: add migration guide if needing webpack built-ins
1 parent 214bcf2 commit eb520a0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/app/references/migration-guide.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,33 @@ As stated earlier, this is likely unnecessary unless you are already using `@cyp
8686

8787
Note that this package version is deprecated and no longer supported by Cypress and is intended as a workaround until you can migrate to Webpack `5`. More information on how to configure the preprocessor can be found in the [Preprocessors API documentation](/api/node-events/preprocessors-api#Usage) and [Webpack Preprocessor documentation](https://github.com/cypress-io/cypress/blob/@cypress/webpack-preprocessor-v6.0.4/npm/webpack-preprocessor/README.md).
8888

89+
### `@cypress/webpack-batteries-included-preprocessor` no longer shims built-ins provided by `webpack` v4
90+
91+
The default file preprocessor, `@cypress/webpack-batteries-included-preprocessor`, no longer shims built-ins. This is mainly to reduce security vulnerabilities and bundle size within the end-to-end file preprocessor.
92+
93+
If these built-ins are required, you can install `@cypress/webpack-batteries-included-preprocessor` independently and follow the webpack documentation described in [webpack's resolve.fallback](https://webpack.js.org/configuration/resolve/#resolvefallback) to configure which built-ins you need.
94+
95+
For example, the following code shows how to provide the `path` built-in to the preprocessor:
96+
97+
```javascript
98+
const webpackPreprocessor = require('@cypress/webpack-batteries-included-preprocessor')
99+
100+
function getWebpackOptions () {
101+
const options = webpackPreprocessor.getFullWebpackOptions()
102+
103+
// add built-ins as needed
104+
options.resolve.fallback.path = require.resolve('path-browserify')
105+
106+
return options
107+
}
108+
109+
module.exports = (on) => {
110+
on('file:preprocessor', webpackPreprocessor({
111+
webpackOptions: getWebpackOptions()
112+
}))
113+
}
114+
```
115+
89116
### Angular `17` CT no longer supported
90117

91118
With [LTS ending](https://angular.dev/reference/releases#actively-supported-versions) for Angular 17, the minimum required Angular version for component testing is now `18.0.0`.

0 commit comments

Comments
 (0)