This repository was archived by the owner on Oct 1, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,21 @@ module.exports = (on) => {
151151}
152152```
153153
154+ ## Debugging
155+
156+ You can see debug messages from this module by running with environment variable
157+
158+ ```
159+ DEBUG=cypress:webpack
160+ ```
161+
162+ You can see Webpack bundle diagnostic output (timings, chunks, sizes) by running with environment variable
163+
164+ ```
165+ DEBUG=cypress:webpack:stats
166+ ```
167+ ![ Webpack stats] ( images/webpack-stats.png )
168+
154169## Contributing
155170
156171Use the [ version of Node that matches Cypress] ( https://github.com/cypress-io/cypress/blob/develop/.node-version ) .
Original file line number Diff line number Diff line change 11const path = require ( 'path' )
22const webpack = require ( 'webpack' )
33const debug = require ( 'debug' ) ( 'cypress:webpack' )
4+ const debugStats = require ( 'debug' ) ( 'cypress:webpack:stats' )
45
56const createDeferred = require ( './deferred' )
67const stubbableRequire = require ( './stubbable-require' )
@@ -149,6 +150,11 @@ const preprocessor = (options = {}) => {
149150 }
150151
151152 debug ( 'finished bundling' , outputPath )
153+ if ( debugStats . enabled ) {
154+ /* eslint-disable-next-line no-console */
155+ console . error ( stats . toString ( { colors : true } ) )
156+ }
157+
152158 // resolve with the outputPath so Cypress knows where to serve
153159 // the file from
154160 latestBundle . resolve ( outputPath )
You can’t perform that action at this time.
0 commit comments