add @cypress/vite-dev-server

This commit is contained in:
Philipp Kühn
2021-08-26 16:49:08 +02:00
parent 629b2c4713
commit 1322f12028
3 changed files with 26 additions and 4 deletions

View File

@@ -11,8 +11,16 @@
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
// eslint-disable-next-line
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
const path = require('path')
const { startDevServer } = require('@cypress/vite-dev-server')
module.exports = on => {
on('dev-server:start', options => {
return startDevServer({
options,
viteConfig: {
configFile: path.resolve(__dirname, '../../demos/vite.config.js'),
},
})
})
}