-
Notifications
You must be signed in to change notification settings - Fork 3.3k
breaking: remove built-ins from @cypress/webpack-batteries-included-preprocessor
#31738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Bump this version to force CI to re-create the cache from scratch. | ||
|
||
5-14-2025 | ||
5-21-2025 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
const Debug = require('debug') | ||
const webpackPreprocessor = require('@cypress/webpack-preprocessor') | ||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin | ||
|
@@ -120,24 +119,6 @@ const getDefaultWebpackOptions = () => { | |
}], | ||
}, | ||
plugins: [ | ||
new webpack.ProvidePlugin({ | ||
Buffer: ['buffer', 'Buffer'], | ||
// As of Webpack 5, a new option called resolve.fullySpecified, was added. | ||
// This option means that a full path, in particular to .mjs / .js files | ||
// in ESM packages must have the full path of an import specified. | ||
// Otherwise, compilation fails as this option defaults to true. | ||
// This means we need to adjust our global injections to always | ||
// resolve to include the full file extension if a file resolution is provided. | ||
// @see https://github.com/cypress-io/cypress/issues/27599 | ||
// @see https://webpack.js.org/configuration/module/#resolvefullyspecified | ||
|
||
// Due to Pnp compatibility issues, we want to make sure that we resolve to the 'process' library installed with the binary, | ||
// which should resolve on leaf app/packages/server/node_modules/@cypress/webpack-batteries-included-preprocessor and up the tree. | ||
// In other words, we want to resolve 'process' that is installed with cypress (or the package itself, i.e. @cypress/webpack-batteries-included-preprocessor) | ||
// and not in the user's node_modules directory as it may not exist. | ||
// @see https://github.com/cypress-io/cypress/issues/27947. | ||
process: require.resolve('process/browser.js'), | ||
}), | ||
// If the user is trying to debug their bundle, we'll add the BundleAnalyzerPlugin | ||
// to see the size of the support file (first bundle when running `cypress open`) | ||
// and spec files (subsequent bundles when running `cypress open`) | ||
|
@@ -146,42 +127,42 @@ const getDefaultWebpackOptions = () => { | |
resolve: { | ||
extensions: ['.js', '.json', '.jsx', '.mjs', '.coffee'], | ||
fallback: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to set everything to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly it isn't entirely clear 😂 . The recommendation AFAIK is to set the fallback to false. What I have noticed, though it isn't documented, is the polyfills sometimes make their way in when you don't specify a config and they just happen to exist in your node_modules directory. But that might be a side effect of something else ![]() |
||
assert: require.resolve('assert/'), | ||
buffer: require.resolve('buffer/'), | ||
assert: false, | ||
buffer: false, | ||
child_process: false, | ||
cluster: false, | ||
console: false, | ||
constants: require.resolve('constants-browserify'), | ||
crypto: require.resolve('crypto-browserify'), | ||
constants: false, | ||
crypto: false, | ||
dgram: false, | ||
dns: false, | ||
domain: require.resolve('domain-browser'), | ||
events: require.resolve('events/'), | ||
domain: false, | ||
events: false, | ||
fs: false, | ||
http: require.resolve('stream-http'), | ||
https: require.resolve('https-browserify'), | ||
http: false, | ||
https: false, | ||
http2: false, | ||
inspector: false, | ||
module: false, | ||
net: false, | ||
os: require.resolve('os-browserify/browser'), | ||
path: require.resolve('path-browserify'), | ||
os: false, | ||
path: false, | ||
perf_hooks: false, | ||
punycode: require.resolve('punycode/'), | ||
process: require.resolve('process/browser.js'), | ||
querystring: require.resolve('querystring-es3'), | ||
punycode: false, | ||
process: false, | ||
querystring: false, | ||
readline: false, | ||
repl: false, | ||
stream: require.resolve('stream-browserify'), | ||
string_decoder: require.resolve('string_decoder/'), | ||
sys: require.resolve('util/'), | ||
timers: require.resolve('timers-browserify'), | ||
stream: false, | ||
string_decoder: false, | ||
sys: false, | ||
timers: false, | ||
tls: false, | ||
tty: require.resolve('tty-browserify'), | ||
url: require.resolve('url/'), | ||
util: require.resolve('util/'), | ||
vm: require.resolve('vm-browserify'), | ||
zlib: require.resolve('browserify-zlib'), | ||
tty: false, | ||
url: false, | ||
util: false, | ||
vm: false, | ||
zlib: false, | ||
}, | ||
plugins: [], | ||
}, | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ describe('devServer', function () { | |
// Writing to disk includes the correct source map size, where the difference will be made up from stat size vs parsed size | ||
// This is critical if a user is trying to debug to determine if they have large source maps or other large files in their dev-server under test | ||
describe('writes to disk if DEBUG=cypress-verbose:webpack-dev-server:bundle-analyzer is set', async () => { | ||
const WEBPACK_DEV_SERVER_VERSIONS: (4 | 5)[] = [4, 5] | ||
const WEBPACK_DEV_SERVER_VERSIONS: (5)[] = [5] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we have a bad merge into the 15 branch. This is very likely failing |
||
|
||
beforeEach(() => { | ||
debug.enable('cypress-verbose:webpack-dev-server:bundle-analyzer') | ||
|
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.