Bit compatible with Vue 2?

79 Views Asked by At

Is there a way to generate a component with Vue 2 using Bit? Right now, seems like creating a component comes with Vue 3 as a peerDependency (which is fine since Vue 2 is going to be out of support by December) but I'm asking if there's a specific version to set or something to start developing components using Vue 2?

2

There are 2 best solutions below

0
On

Assuming you already install Bit by a npm install bit-bin --global.

First, navigate to your project directory and initialize Bit.

Create a component or generate using vue-generate-component.

In your component's package.json file, specify dependency like;

"peerDependencies": {
 "vue": "^2.6.12"
}

Track the component using bit add > bit add src/components/your-component.

Once you've made changes to your component, you can tag it;

bit tag --all 1.0.0

Finally, you can export your component to a remote scope by a bit export user-name.scope-name.

*Replace user-name and scope-name with your actual Bit username and scope name.

"Note that while Bit supports Vue 2, it's recommended to start using Vue 3 for new projects as Vue 2 is going to be out of support by December 2023."

0
On

No, Bit.dev does not support Vue 2.0

Support for Vue is rather recent, and as such only available from Vue 3 and up. Please consult the documentation.