Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

290
Views
How to make Bootstrap-Vue / Vue 2 work with Vite

I have a project running some Vue2/BootstrapVue components, setup on webpacker, and I'm trying to migrate from webpacker to vite and got some Bootstrap Vue issues along the way, like Multiple instances of Vue detected or $attr and $listeners is readonly, just like described in BootstrapVue's documentation here

Now, in order to fix this, in webpacker, somewhere in my config i was doing this:

const resolver = {
   resolve: {
      alias: {
         'vue$': 'vue/dist/vue.esm.js'
      }
   }
};

environment.config.merge(resolver)

I tried doing something similar in vite, by adding the following in my vite.config.ts file, but this doesn't seem to work, so I'm probably not doing it right:

import {defineConfig} from 'vite'
import RubyPlugin from 'vite-plugin-ruby'
import {createVuePlugin} from "vite-plugin-vue2";

export default defineConfig({
    plugins: [
        RubyPlugin(),
        createVuePlugin()
    ],
    resolve: {
        alias: {
            'vue$': 'vue/dist/vue.esm.js'
        }
    }
})

So my question is what would be the recommended fix for this issue

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Vite provides a resolve.dedupe setting which you can use when running into duplication problems:

export default defineConfig({
  resolve: {
    dedupe: ['vue', 'vue-router'],
  },
})

However, this is not usual for vue, in most cases it works well out of the box.

Try removing the vue$ alias and switch your imports to use vue, Vite should automatically optimize it as a dependency and correctly resolve imports.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!