intlify / vite-plugin-vue-i18n

:globe_with_meridians: Vite plugin for Vue I18n
MIT License
128 stars 8 forks source link

Regression: resolve.alias as an array do not work any more #62

Closed stafyniaksacha closed 3 years ago

stafyniaksacha commented 3 years ago

As mentioned on rollup-alias documentation aliases can be defined by an array or an object.

// object aliases
import { defineConfig } from 'vite'

export default defineConfig({
  resolve: {
    alias: {
      '/@src/': `${path.resolve(__dirname, 'src')}/`,
    },
  },
})

-- or

// array aliases
import { defineConfig } from 'vite'

export default defineConfig({
  resolve: {
    alias: [
      {
        find: '/@src/',
        replacement: `${path.resolve(__dirname, 'src')}/`,
      },
    ],
  },
})

I noticed that when upgrading vite-plugin-vue-i18n from 1.0.0-beta.16 to 2.0.0-rc.1 the array aliases notation do not work any more for the entire project