Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webpack loader #114

Closed
mkusher opened this issue Nov 18, 2018 · 5 comments
Closed

Add webpack loader #114

mkusher opened this issue Nov 18, 2018 · 5 comments

Comments

@mkusher
Copy link
Contributor

mkusher commented Nov 18, 2018

Webpack can be supported by having a loader for .feature files, similar to what is already done for browserify.

Current workaround when using webpack is to have both webpack for .ts and browserify for .feature. Example (#18 (comment))

on('file:preprocessor', (file) => {
    if (file.filePath.match(/\.(js|jsx)/g)) {
      return webpack(options)(file)
    } else {
      return cucumber()(file)
    }
})

Having loader might be a solution for: #112

@lgandecki
Copy link
Collaborator

I don't understand what you mean, what's the usecase? can you do this as a showcase? I don't want to add things to the codebase just because we can.
The #112 I believe is invalid, as I (and most people) used typescript with import/export.

@mkusher
Copy link
Contributor Author

mkusher commented Nov 20, 2018

it's useful for projects where webpack is already configured for transpiling cypress. Right now cucumber preprocessor will use browserify for .feature and everything it will require/import, e.g. step definitions. This means that step definitions won't respect my webpack configuration(and shouldn't since they are transpiled using browserify), so one has to duplicate all configurations for both webpack and browserify

@lgandecki
Copy link
Collaborator

Would it be a lot of effort to create a simple repo to show this setup? Not sure why would you have to duplicate configuration, do you reuse files between tests and app?

mkusher referenced this issue in mkusher/cypress-cucumber-preprocessor Nov 21, 2018
@mkusher
Copy link
Contributor Author

mkusher commented Nov 21, 2018

@lgandecki no, I don't share code between tests and app, I just have a configuration for ts paths and webpack aliases that I would like to reuse in both specs and steps

@lgandecki
Copy link
Collaborator

Closed in #115 , thank you so much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants