File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,5 @@ module.exports = {
4040 "vue-jsx-hot-loader" : require . resolve ( "../" ) ,
4141 } ,
4242 } ,
43+ devtool : "cheap-module-eval-source-map" ,
4344} ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @ant-design-vue/vue-jsx-hot-loader" ,
3- "version" : " 0.1.1 " ,
3+ "version" : " 0.1.2 " ,
44 "description" : " Tweak Vue components written in JSX in real time." ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export default function loader(
100100 if ( hotComponents . length ) {
101101 if ( defaultIdentifier ) {
102102 const { name } = defaultIdentifier as t . Identifier ;
103- source . replace (
103+ source = source . replace (
104104 / 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,
105105 `const ${ name } = defineComponent`
106106 ) + `\nexport default ${ name } `
@@ -114,13 +114,12 @@ export default function loader(
114114 callbackCode += `\n__VUE_HMR_RUNTIME__.reload("${ id } ", ${ local } )`
115115 }
116116
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}`
124123 }
125124
126125 return source ;
You can’t perform that action at this time.
0 commit comments