File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable no-undef */
22const { defineConfig } = require ( 'cypress' ) ;
33const fs = require ( 'fs' ) ;
4+ const { resolve } = require ( 'path' ) ;
5+ // TODO: Upgrade @cypress /webpack-preprocessor to latest once Webpack is upgraded
6+ const webpackPreprocessor = require ( '@cypress/webpack-preprocessor' ) ;
7+ // TODO: Use webpack-configs from shared.js once Webpack is upgraded
8+ // const webpackConfigOptions = require('./config/webpack/shared.js');
9+
10+ // TODO: Relocate the aliases to webpack-config and reference its options directly from shared.js.
11+ const webpackConfigOptions = {
12+ resolve : {
13+ alias : {
14+ '@cypress-dir' : resolve ( __dirname , 'cypress' ) ,
15+ } ,
16+ extensions : [ '.js' ] ,
17+ } ,
18+ } ;
419
520module . exports = defineConfig ( {
621 e2e : {
@@ -44,6 +59,12 @@ module.exports = defineConfig({
4459 console . log ( 'Actual args:' , launchOptions . args ) ;
4560 return launchOptions ;
4661 } ) ;
62+ on (
63+ 'file:preprocessor' ,
64+ webpackPreprocessor ( {
65+ webpackOptions : webpackConfigOptions ,
66+ } )
67+ ) ;
4768 } ,
4869 } ,
4970} ) ;
You can’t perform that action at this time.
0 commit comments