File tree 3 files changed +9
-9
lines changed
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,5 @@ module.exports = {
40
40
"vue-jsx-hot-loader" : require . resolve ( "../" ) ,
41
41
} ,
42
42
} ,
43
+ devtool : "cheap-module-eval-source-map" ,
43
44
} ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @ant-design-vue/vue-jsx-hot-loader" ,
3
- "version" : " 0.1.1 " ,
3
+ "version" : " 0.1.2 " ,
4
4
"description" : " Tweak Vue components written in JSX in real time." ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export default function loader(
100
100
if ( hotComponents . length ) {
101
101
if ( defaultIdentifier ) {
102
102
const { name } = defaultIdentifier as t . Identifier ;
103
- source . replace (
103
+ source = source . replace (
104
104
/ e x p o r t d e f a u l t d e f i n e C o m p o n e n t / g,
105
105
`const ${ name } = defineComponent`
106
106
) + `\nexport default ${ name } `
@@ -114,13 +114,12 @@ export default function loader(
114
114
callbackCode += `\n__VUE_HMR_RUNTIME__.reload("${ id } ", ${ local } )`
115
115
}
116
116
117
- source += `
118
- /* hot reload */
119
- if (module.hot) {
120
- module.hot.accept()
121
- ${ callbackCode }
122
- }
123
- `
117
+ source +=
118
+ `\n/* hot reload */` +
119
+ `\nif (module.hot) {` +
120
+ `\n module.hot.accept()` +
121
+ `\n ${ callbackCode } ` +
122
+ `\n}`
124
123
}
125
124
126
125
return source ;
You can’t perform that action at this time.
0 commit comments