From d199c6c7753245725b0f2ed5fd3902290d8d195f Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 11 Dec 2022 19:06:33 +0900 Subject: [PATCH] fix(unplugin-vue-i18n): generate sourcemap for ts/js (#208) * fix(unplugin-vue-i18n): genrate sourcemap for ts/js * update source map snapshot --- packages/unplugin-vue-i18n/src/index.ts | 4 ---- .../test/vite/__snapshots__/sourcemap.test.ts.snap | 14 +++++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/unplugin-vue-i18n/src/index.ts b/packages/unplugin-vue-i18n/src/index.ts index 85d1f1e..7ed2c68 100644 --- a/packages/unplugin-vue-i18n/src/index.ts +++ b/packages/unplugin-vue-i18n/src/index.ts @@ -453,10 +453,6 @@ export const unplugin = createUnplugin((options = {}, meta) => { } else { // TODO: support virtual import identifier // for virtual import identifier (@intlify/unplugin-vue-i18n/messages) - return { - code, - map: { mappings: '', version: '3', sources: [] } - } } } else { // for Vue SFC diff --git a/packages/unplugin-vue-i18n/test/vite/__snapshots__/sourcemap.test.ts.snap b/packages/unplugin-vue-i18n/test/vite/__snapshots__/sourcemap.test.ts.snap index dbcc4ac..4660cc1 100644 --- a/packages/unplugin-vue-i18n/test/vite/__snapshots__/sourcemap.test.ts.snap +++ b/packages/unplugin-vue-i18n/test/vite/__snapshots__/sourcemap.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`custom blocks: json 1`] = `";;;;;;;;;;;;;;;;;;;;;;;;;"`; +exports[`custom blocks: json 1`] = `";;;;;;;;;;;;;;;;;;;;;AAGA,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,SAASA;AAChB,SAAO,UAAU;AACnB;"`; -exports[`custom blocks: json5 1`] = `";;;;;;;;;;;;;;;;;;;;;;;;;"`; +exports[`custom blocks: json5 1`] = `";;;;;;;;;;;;;;;;;;;;;AAGA,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,SAASA;AAChB,SAAO,UAAU;AACnB;"`; -exports[`custom blocks: yaml 1`] = `";AACOA,YAAAA,SAAAA,UAAAA,UAAAA,CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"`; +exports[`custom blocks: yaml 1`] = `";AACOA,YAAAA,SAAAA,UAAAA,UAAAA,CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEP,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,SAASC;AAChB,SAAO,UAAU;AACnB;"`; -exports[`custom blocks: yml 1`] = `";;;;;;;;;;;;;;;;;;;;;;;"`; +exports[`custom blocks: yml 1`] = `";;;;;;;;;;;;;;;;;;;AAGA,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,SAASA;AAChB,SAAO,UAAU;AACnB;"`; -exports[`resource files: json 1`] = `";;;wCACYA,aAAAA,MAAAA,CAAAA,CAAAA,GAAAA,WAAAC,CAAAC,aAAAA,MAAAA,CAAAA,CAAAA,GAAAA,QAAAA,CAAAA,GAAAA,WAAAC,CAAAC,aAAAA,OAAAA,GAAAA,CAAAA,GAAAA,SAAAA,CAAAA,CAAAA,CAAAA;AAAAA,EAAAA;AAAAA;IAEAC,SAAAA,CAAAA,QAAAA;AAAAA,YAAAA,EAAAA,WAAAA,YAAAA,aAAAA,cAAAA,OAAAA,WAAAA;AAAAA,aAAAA,WAAAA,CAAAA,UAAAC,aAAAA,OAAAA,MAAAA,CAAAA,GAAAA,GAAAA,CAAAA;AAAAA,IAAAA;AAAAA;;;;;;;;;;;;;;;;;;;;;;;"`; +exports[`resource files: json 1`] = `";;;wCACYA,aAAAA,MAAAA,CAAAA,CAAAA,GAAAA,WAAAC,CAAAC,aAAAA,MAAAA,CAAAA,CAAAA,GAAAA,QAAAA,CAAAA,GAAAA,WAAAC,CAAAC,aAAAA,OAAAA,GAAAA,CAAAA,GAAAA,SAAAA,CAAAA,CAAAA,CAAAA;AAAAA,EAAAA;AAAAA;IAEAC,SAAAA,CAAAA,QAAAA;AAAAA,YAAAA,EAAAA,WAAAA,YAAAA,aAAAA,cAAAA,OAAAA,WAAAA;AAAAA,aAAAA,WAAAA,CAAAA,UAAAC,aAAAA,OAAAA,MAAAA,CAAAA,GAAAA,GAAAA,CAAAA;AAAAA,IAAAA;AAAAA;;;;;;;;;;;;;;;;;;;ACAZ,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,SAAS;AAChB,SAAO,UAAU;AACnB;"`; -exports[`resource files: json5 1`] = `";;;;;;;;;;;;;;"`; +exports[`resource files: json5 1`] = `";;;;;;;;;;AAGA,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,SAAS;AAChB,SAAO,UAAU;AACnB;"`; -exports[`resource files: yaml 1`] = `";;;;;;;;;;;;;;"`; +exports[`resource files: yaml 1`] = `";;;;;;;;;;AAGA,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,SAAS;AAChB,SAAO,UAAU;AACnB;"`;