Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
feat: add preprocessor plugin, exclude from gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCube42 authored and anthonymjones committed Mar 22, 2020
1 parent ac295ff commit d746a04
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ yarn-error.log*
# Mac OSX Finder files.
**/.DS_Store
.DS_Store

# Exclude Cypress Plugin JS files
!src/schematics/cypress/files/cypress/plugins/*.js
26 changes: 26 additions & 0 deletions src/schematics/cypress/files/cypress/plugins/cy-ts-preprocessor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const wp = require("@cypress/webpack-preprocessor");

const webpackOptions = {
resolve: {
extensions: [".ts", ".js"]
},
module: {
rules: [
{
test: /\.ts$/,
exclude: [/node_modules/],
use: [
{
loader: "ts-loader"
}
]
}
]
}
};

const options = {
webpackOptions
};

module.exports = wp(options);
5 changes: 5 additions & 0 deletions src/schematics/cypress/files/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const cypressTypeScriptPreprocessor = require("./cy-ts-preprocessor");

module.exports = on => {
on("file:preprocessor", cypressTypeScriptPreprocessor);
};

0 comments on commit d746a04

Please sign in to comment.