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

Allow writing config file in es6, coffee, typescript #34

Open
vdanchenkov opened this issue Jul 19, 2016 · 2 comments
Open

Allow writing config file in es6, coffee, typescript #34

vdanchenkov opened this issue Jul 19, 2016 · 2 comments

Comments

@vdanchenkov
Copy link

My suggestion is to make use of https://github.com/js-cli/js-interpret like it's done in webpack. For example, in order to enable babel transpiling of the config, user will have to do following:

  1. npm install babel-register
  2. configure .babelrc
  3. rename config to .markdown-doctest-setup.babel.js

I can work on it and provide PR if you are ok with this change.

For those who came here looking for a solution, quick fix is to follow steps from above by putting this to .markdown-doctest-setup.js:

  require('babel-register')
  module.exports = require('./.markdown-doctest-setup.babel.js') 
@Widdershin
Copy link
Owner

@vdanchenkov since this tool already bundles babel, I've been considering just compiling the config before running. This would save user configuration, as ES6 would just work, but this might complicate the approach for typescript/coffescript.

What do you think?

@vdanchenkov
Copy link
Author

@Widdershin I can imagine only one reason to use something different from es5 for config file. You do it if your project is written in given dialect already. For this case we can assume that all the configuration is done project-wide.

Idea is to pick up configuration of the whole project by simple file extension change.

Actually, my project is written in es6 and it's the only concern for me, but it would be good if other dialects happen to work out of the box in described way.

For reference, that's how I use it https://github.com/vdanchenkov/mobile-coverage-russia/blob/master/.markdown-doctest-setup.babel.js

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