Skip to content

Commit 281f55f

Browse files
committed
fix(plugin-vue-jsx): support ssr
close #1939
1 parent 30949d9 commit 281f55f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: packages/plugin-vue-jsx/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const importMeta = require('@babel/plugin-syntax-import-meta')
55
const hash = require('hash-sum')
66

77
/**
8-
* @param {import('.').Options} options
8+
* @param {import('@vue/babel-plugin-jsx').VueJSXPluginOptions} options
99
* @returns {import('vite').Plugin}
1010
*/
1111
function vueJsxPlugin(options = {}) {
@@ -35,7 +35,7 @@ function vueJsxPlugin(options = {}) {
3535
needSourceMap = config.command === 'serve' || !!config.build.sourcemap
3636
},
3737

38-
transform(code, id) {
38+
transform(code, id, ssr) {
3939
if (/\.[jt]sx$/.test(id)) {
4040
const plugins = [importMeta, [jsx, options]]
4141
if (id.endsWith('.tsx')) {
@@ -53,7 +53,7 @@ function vueJsxPlugin(options = {}) {
5353
sourceFileName: id
5454
})
5555

56-
if (!needHmr) {
56+
if (ssr || !needHmr) {
5757
return {
5858
code: result.code,
5959
map: result.map

0 commit comments

Comments
 (0)