Skip to content

Instantly share code, notes, and snippets.

Last active June 28, 2022 18:05
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Cypress + Typescript ts-loader option `transpileOnly` config helps with memory-contrained machines if you're not running in the Cypress Dashboard but rather using custom Jenkins CI, etc.
module.exports = (on, config) => {
// ...
const wpOptions = webpack.defaultOptions
wpOptions.webpackOptions.resolve = {
extensions: ['.ts', '.js'],
test: /\.ts$/,
exclude: [/node_modules/],
use: [
loader: 'ts-loader',
options: {
transpileOnly: true, //
on('file:preprocessor', webpack(wpOptions))
// ...
Copy link

chiptus commented Jun 28, 2022

where does webpack comes from? should I do const webpack = require('webpack')?

Copy link

@chiptus I don't think this is an issue anymore using recent versions of Cypress, at the time this was a problem in v2 and v3. If that is what you're stuck on, yes you would need to import webpack somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment