Skip to content

Instantly share code, notes, and snippets.

@meDavid
Created January 11, 2019 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meDavid/806835dc47f06797b711c1385c45126c to your computer and use it in GitHub Desktop.
Save meDavid/806835dc47f06797b711c1385c45126c to your computer and use it in GitHub Desktop.
// Copy of https://github.com/bahmutov/cypress-angular-unit-test/blob/master/cypress/plugins/cy-ts-preprocessor.js
const wp = require('@cypress/webpack-preprocessor')
const webpackOptions = {
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
loaders: ['ts-loader', 'angular2-template-loader'],
exclude: [/node_modules/],
},
{
test: /\.(html|css)$/,
loader: 'raw-loader',
exclude: /\.async\.(html|css)$/
},
{
test: /\.async\.(html|css)$/,
loaders: ['file?name=[name].[hash].[ext]', 'extract']
}
]
}
}
const options = {
webpackOptions
}
module.exports = wp(options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment