Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cypress/webpack-dev-server

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypress/webpack-dev-server

Launches Webpack Dev Server for Component Testing

  • 3.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
135K
decreased by-6.45%
Maintainers
1
Weekly downloads
 
Created

What is @cypress/webpack-dev-server?

@cypress/webpack-dev-server is a utility that allows you to use Webpack as the dev server for Cypress component testing. It integrates Webpack with Cypress to enable seamless testing of components in a development-like environment.

What are @cypress/webpack-dev-server's main functionalities?

Integration with Cypress

This feature allows you to integrate Webpack with Cypress. The code sample demonstrates how to configure Cypress to use Webpack as its dev server by providing the necessary Webpack configuration.

const { startDevServer } = require('@cypress/webpack-dev-server');
const webpackConfig = require('./webpack.config');

module.exports = (on, config) => {
  on('dev-server:start', (options) =>
    startDevServer({ options, webpackConfig })
  );
  return config;
};

Custom Webpack Configuration

This feature allows you to use a custom Webpack configuration for your Cypress tests. The code sample shows how to pass a custom Webpack configuration to the `startDevServer` function.

const { startDevServer } = require('@cypress/webpack-dev-server');
const customWebpackConfig = {
  // custom webpack configuration
};

module.exports = (on, config) => {
  on('dev-server:start', (options) =>
    startDevServer({ options, webpackConfig: customWebpackConfig })
  );
  return config;
};

Hot Module Replacement (HMR)

This feature enables Hot Module Replacement (HMR) for faster development. The code sample demonstrates how to configure HMR in the Webpack configuration used by Cypress.

const { startDevServer } = require('@cypress/webpack-dev-server');
const webpackConfig = require('./webpack.config');

webpackConfig.devServer = {
  hot: true,
};

module.exports = (on, config) => {
  on('dev-server:start', (options) =>
    startDevServer({ options, webpackConfig })
  );
  return config;
};

Other packages similar to @cypress/webpack-dev-server

FAQs

Package last updated on 21 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc