File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ const compileBabel = require('./compilers/babel-compiler')
7
7
const compileTypescript = require ( './compilers/typescript-compiler' )
8
8
const compileCoffeeScript = require ( './compilers/coffee-compiler' )
9
9
const extractPropsFromFunctionalTemplate = require ( './extract-props' )
10
+ const fs = require ( 'fs' )
11
+ const join = require ( 'path' ) . join
10
12
11
13
const splitRE = / \r ? \n / g
12
14
@@ -41,6 +43,10 @@ module.exports = function (src, path) {
41
43
42
44
changePartsIfFunctional ( parts )
43
45
46
+ if ( parts . script && parts . script . src ) {
47
+ parts . script . content = fs . readFileSync ( join ( path , '..' , parts . script . src ) , 'utf8' )
48
+ }
49
+
44
50
const result = processScript ( parts . script )
45
51
const script = result . code
46
52
const inputMap = result . sourceMap
@@ -53,6 +59,10 @@ module.exports = function (src, path) {
53
59
': module.exports)\n'
54
60
55
61
if ( parts . template ) {
62
+ if ( parts . template . src ) {
63
+ parts . template . content = fs . readFileSync ( join ( path , '..' , parts . template . src ) , 'utf8' )
64
+ }
65
+
56
66
const renderFunctions = compileTemplate ( parts . template )
57
67
58
68
output += '__vue__options__.render = ' + renderFunctions . render + '\n' +
You can’t perform that action at this time.
0 commit comments