try esbuild

This commit is contained in:
Ulf Gebhardt 2025-08-07 16:06:22 +02:00
parent 207002f2fd
commit f25046c739
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
3 changed files with 64 additions and 1209 deletions

View File

@ -1,25 +1,33 @@
const dotenv = require('dotenv')
const { defineConfig } = require('cypress');
const browserify = require('@cypress/browserify-preprocessor');
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor");
const {
addCucumberPreprocessorPlugin,
} = require('@badeball/cypress-cucumber-preprocessor');
const {
preprendTransformerToOptions,
} = require('@badeball/cypress-cucumber-preprocessor/browserify');
createEsbuildPlugin,
} = require("@badeball/cypress-cucumber-preprocessor/esbuild");
// Test persistent(between commands) store
const testStore = {}
async function setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config);
const bundler = createBundler({
plugins: [createEsbuildPlugin(config)],
})
on(
'file:preprocessor',
browserify(preprendTransformerToOptions(config, browserify.defaultOptions)),
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin(config)],
platform: 'node',
})
);
on('task', {
/* on('task', {
pushValue({ name, value }) {
testStore[name] = value
return true
@ -28,7 +36,7 @@ async function setupNodeEvents(on, config) {
console.log('getValue',name,testStore)
return testStore[name]
},
});
}); */
return config;
}

View File

@ -37,8 +37,8 @@
"@babel/preset-env": "^7.28.0",
"@babel/register": "^7.27.1",
"@badeball/cypress-cucumber-preprocessor": "^22.2.0",
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.5",
"@cucumber/cucumber": "12.1.0",
"@cypress/browserify-preprocessor": "^3.0.2",
"@faker-js/faker": "9.9.0",
"auto-changelog": "^2.5.0",
"bcryptjs": "^3.0.2",

1249
yarn.lock

File diff suppressed because it is too large Load Diff