mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-07 23:40:21 -05:00
feat: Use plugins on config files (#18798)
Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
This commit is contained in:
committed by
GitHub
parent
8a2acdcdfa
commit
bb8251b752
@@ -1,4 +1,15 @@
|
||||
module.exports = {
|
||||
'fixturesFolder': false,
|
||||
'supportFile': false,
|
||||
'e2e': {
|
||||
setupNodeEvents (on, config) {
|
||||
const webpackPreprocessor = require('../..')
|
||||
const defaults = webpackPreprocessor.defaultOptions
|
||||
|
||||
delete defaults.webpackOptions.module.rules[0].use[0].options.presets
|
||||
on('file:preprocessor', webpackPreprocessor(defaults))
|
||||
|
||||
return config
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
const webpackPreprocessor = require('../../../..')
|
||||
const defaults = webpackPreprocessor.defaultOptions
|
||||
|
||||
module.exports = (on) => {
|
||||
delete defaults.webpackOptions.module.rules[0].use[0].options.presets
|
||||
on('file:preprocessor', webpackPreprocessor(defaults))
|
||||
}
|
||||
@@ -3,4 +3,15 @@ import { defineConfig } from 'cypress'
|
||||
export default defineConfig({
|
||||
'fixturesFolder': false,
|
||||
'supportFile': false,
|
||||
'e2e': {
|
||||
async setupNodeEvents (on, config) {
|
||||
const webpackPreprocessor = await import('../..')
|
||||
|
||||
const webpack = await import('./webpack.config')
|
||||
|
||||
on('file:preprocessor', webpackPreprocessor({ webpack }))
|
||||
|
||||
return config
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
const webpackPreprocessor = require('../../../..')
|
||||
|
||||
module.exports = (on) => {
|
||||
const webpack = require('../../webpack.config.js')
|
||||
|
||||
on('file:preprocessor', webpackPreprocessor({ webpack }))
|
||||
}
|
||||
Reference in New Issue
Block a user