Skip to content

Commit 0775635

Browse files
committed
fix: path prefix in template
1 parent 7a77740 commit 0775635

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/mp-compiler/templates.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
const { getPathPrefix } = require('./util')
22

33
function genScript (name, isPage, src) {
4-
const prefix = isPage ? getPathPrefix(src) : '.'
4+
const prefix = isPage ? getPathPrefix(src) : './'
55

66
return `
7-
require('${prefix}/static/js/manifest')
8-
require('${prefix}/static/js/vendor')
9-
require('${prefix}/static/js/${name}')
7+
require('${prefix}static/js/manifest')
8+
require('${prefix}static/js/vendor')
9+
require('${prefix}static/js/${name}')
1010
`
1111
}
1212

1313
function genStyle (name, isPage, src) {
14-
const prefix = isPage ? getPathPrefix(src) : '.'
15-
return `@import "${prefix}/static/css/${name}.wxss";`
14+
const prefix = isPage ? getPathPrefix(src) : './'
15+
return `@import "${prefix}static/css/${name}.wxss";`
1616
}
1717

1818
function genPageWxml (templateName, src) {

0 commit comments

Comments
 (0)