Can I modify a build/test environments?


I’ve started to work with Bit, and I’m able to set up a compiler for my components, but to build my components properly I need to add additional plugins to the .babelrc file in the compiler (
How do I do that?

Well, what I found that worked for me is to handle a build env just like any other component… Basically, import it and export your own version, just like you can modify a component and export it to another scope.

This was my flow:

  1. Create a new directory and an empty workspace in it
  2. Import the environment you want to modify (but without the --compiler/tester flag)
  3. Open and modify the .babelrc file of the component
  4. Tag and export the new version of the component to your own scope

Now you have your own compiler with a modified set of plugins.
The next step is to head back to your project, and modify the bit.json file to point to the new compiler, run bit status to see that all components are now modified (due to the modified compiler). Tag and export a new version, with the new compiler.

Hope this helps!

1 Like

Ok, thanks, ill give it a try.
When I come to think of it, can I pass my own config to a compiler, rather than modify and create my own?

hi @mamugev , you are right… it’s a much more developer friendly approach.
This is why we have started to implement this exact feature.

It’s still in alpha stage, not stable enough, but I think that in the next few weeks it’ll be ready.

oh, ammm… will these new APIs require me to modify any of my components?

No worries, we’re making sure to be fully backward compatible with this feature, as many teams have their own compilers, and we do not want to break their workflow.

Hi @itay. Is this already done or still work in progress?

1 Like

I would really like to be able to pass a config to the typescript compiler to have it generate the type definititon file(s) for my TS components. I am getting a little lost trying to fork and utilize a new a forked compiler. @Itay is this ready for us to use?

this is not released yet, as we found it to be a bit harder to implement. especially in how to manage different config to the same components across different projects, and how to decide if its something that needs to be a part of the component or not (this is especially relevant to decide if a component is modified or not).

We’ve pushed it back a bit, but still working on it.

Is that possible to provide a repository in Github with the configuration mentioned by sharon-p?