Skip to content

Commit fca5a1f

Browse files
committed
fix: page 中 config 可能不存在
1 parent f22c7ca commit fca5a1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/mars-build/src/compiler/script/babel-plugin-script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ module.exports = function getVisitor(options = {}) {
170170

171171
const mpType = isApp
172172
? 'app'
173-
: file.config.component ? 'component' : 'page';
173+
: (file.config && file.config.component) ? 'component' : 'page';
174174

175175
if (mpType === 'app' || mpType === 'page') {
176176
const fnName = capitalize(mpType);

0 commit comments

Comments
 (0)