File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,22 @@ module.exports = function (content) {
20
20
const compiled = compiler . compile ( result . data , {
21
21
preserveWhitespace : false ,
22
22
} ) ;
23
+
24
+ const transpileCode = `var render = function (${ options . functional ? '_h,_vm' : '' } ) { ${ compiled . render } };` ;
23
25
24
- component = transpile ( `var render = function () {${ compiled . render } };` ) ;
25
- component += `module.exports = { render: render };` ;
26
+ const transpileOptions = {
27
+ transforms : {
28
+ stripWithFunctional : ! ! options . functional || false ,
29
+ }
30
+ } ;
31
+
32
+ component = `${ transpile ( transpileCode , transpileOptions ) } \n` ;
33
+
34
+ if ( options . functional ) {
35
+ component += 'module.exports = { functional: true, render: render };' ;
36
+ } else {
37
+ component += 'module.exports = { render: render };' ;
38
+ }
26
39
27
40
cb ( null , component ) ;
28
41
} )
You can’t perform that action at this time.
0 commit comments