Skip to content
This repository was archived by the owner on Jul 4, 2021. It is now read-only.

Commit 96182e5

Browse files
authored
improvement: support named & default exporting (#40)
1 parent db2f640 commit 96182e5

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ the below example that `examples/composition/vite.config.ts`:
4343
import path from 'path'
4444
import { defineConfig } from 'vite'
4545
import vue from '@vitejs/plugin-vue'
46-
import { vueI18n } from '@intlify/vite-plugin-vue-i18n'
46+
import vueI18n from '@intlify/vite-plugin-vue-i18n'
4747

4848
export default defineConfig({
4949
plugins: [

examples/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'path'
22
import { defineConfig } from 'vite'
33
import vue from '@vitejs/plugin-vue'
4-
import { vueI18n } from '../src/index'
4+
import vueI18n from '../src/index'
55

66
export default defineConfig({
77
build: {

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,6 @@ function getOptions(
158158
}
159159
}
160160

161+
// overwrite for cjs require('...')() usage
162+
export default pluginI18n
161163
export const vueI18n = pluginI18n

test/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path'
33
import { build } from 'vite'
44
import vue from '@vitejs/plugin-vue'
55
import { JSDOM, VirtualConsole } from 'jsdom'
6-
import { vueI18n } from '../src/index'
6+
import vueI18n from '../src/index'
77

88
async function bundle(fixture: string, options: Record<string, unknown> = {}) {
99
const input = (options.input as string) || './fixtures/entry.ts'

0 commit comments

Comments
 (0)