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 possibility to define configuration with customPreprocessors #19

Closed
mjeanroy opened this issue Mar 27, 2017 · 3 comments
Closed

Add possibility to define configuration with customPreprocessors #19

mjeanroy opened this issue Mar 27, 2017 · 3 comments

Comments

@mjeanroy
Copy link
Contributor

Hi @jlmakes ,

Currently, the only way to specify rollup configuration is with the rollupPreprocessor: easy, and enough for 99% use case.

But, it could be great to support configuration using customPreprocessors (documented here, or you can see it implemented by karma-babel-preprocessor).

It could be a simple solution to provide different rollup configuration for specific files, for example:

module.exports = (config) => {
  config.set({
    // Karma Configuration
    // ...

    preprocessors: {
      'test/index1.js': ['rollup'],
      'test/index2.js': ['rollupCustom'],
    },

    rollupPreprocessor: {
      // Default rollup configuration...
    },

    customPreprocessors: {
      rollupCustom: {
        base: 'rollup',
        // Custom rollup configuration for this file...
      },
    },
  });
});

I already made some tests on a project and I would be happy to open a PR for that, what do you think?

mjeanroy added a commit to mjeanroy/karma-rollup-preprocessor that referenced this issue Mar 28, 2017
mjeanroy added a commit to mjeanroy/karma-rollup-preprocessor that referenced this issue Mar 28, 2017
mjeanroy added a commit to mjeanroy/karma-rollup-preprocessor that referenced this issue Mar 28, 2017
mjeanroy added a commit to mjeanroy/karma-rollup-preprocessor that referenced this issue Mar 28, 2017
@jlmakes
Copy link
Owner

jlmakes commented Mar 28, 2017

Thanks @mjeanroy I appreciate the contribution!
Next change I get, I’ll merge and prepare a new release.

@mjeanroy
Copy link
Contributor Author

mjeanroy commented Mar 29, 2017

Ok, thank you!

Please let me know when you do, this feature will make my life easier 😉

@jlmakes
Copy link
Owner

jlmakes commented Apr 4, 2017

Yeaah buddy, this is now in version 4.0.0 @mjeanroy

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

No branches or pull requests

2 participants