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

@cypress/webpack-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypress/webpack-preprocessor

Cypress preprocessor for bundling JavaScript via webpack

  • 6.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-1.95%
Maintainers
1
Weekly downloads
 
Created

What is @cypress/webpack-preprocessor?

The @cypress/webpack-preprocessor package is a plugin for Cypress that allows you to use webpack to preprocess your JavaScript files before they are loaded into Cypress. This enables you to use webpack features such as ES6 syntax, importing CSS or images, and bundling your test files.

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

Preprocessing test files with webpack

This feature allows you to preprocess your test files using webpack. You can specify your webpack configuration and watch options. This is useful for using ES6/ESNext features, importing CSS, images, or other assets in your test files.

const webpackPreprocessor = require('@cypress/webpack-preprocessor');

module.exports = (on) => {
  const options = {
    webpackOptions: require('./webpack.config'),
    watchOptions: {}
  };

  on('file:preprocessor', webpackPreprocessor(options));
};

Customizing webpack configuration

This feature allows you to customize the webpack configuration used for preprocessing. In this example, TypeScript files are being handled by adding a rule for `.ts` files and using the `ts-loader`.

const webpackPreprocessor = require('@cypress/webpack-preprocessor');
const webpackOptions = {
  resolve: {
    extensions: ['.ts', '.js']
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        exclude: /node_modules/,
        use: [{ loader: 'ts-loader' }]
      }
    ]
  }
};

const options = {
  webpackOptions,
  watchOptions: {}
};

module.exports = (on) => {
  on('file:preprocessor', webpackPreprocessor(options));
};

Other packages similar to @cypress/webpack-preprocessor

Keywords

FAQs

Package last updated on 07 Jun 2024

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