intlify/rollup-plugin-vue-i18n

Incompatible with rollup-plugin-vue 5.1.6

freblast opened this issue · 4 comments

When using latest rollup-plugin-vue (5.1.6) the custom block outputs "customBlock.0.json" instead of "i18n.0.json" which causes the test in this plugin to fail.

Could you provide minimum reproduction codes, please?

Update to rollup-plugin-vue (5.1.6) and run unit test

Maybe not work after this change
Diff 5.1.4...master

here
https://github.com/intlify/rollup-plugin-vue-i18n/blob/master/src/index.ts#L11

ID rollup 5.1.4
.vue?rollup-plugin-vue=i18n.0.json
before update 5.1.6
.vue?rollup-plugin-vue=customBlocks.0.json

Before
replace
<i18n lang="json">
To
<i18n>

Return id
.vue?rollup-plugin-vue=customBlocks.0.i18n

And
replace plugin transform
if (/rollup-plugin-vue=i18n/i.test(id)) {
To
if (/rollup-plugin-vue=.*i18n/i.test(id)) {
Doesn't add i18n code

@Mertico
Thank you for your easy to understand explanation!

As well as rollup-plugin-vue, we need to change rollup-plugin-vue-i18n.

@kazupon
Do not do without editing rollup-plugin-vue via generating ids
vuejs/rollup-plugin-vue#333