Skip to content

Commit 092712b

Browse files
committed
bugfix: error message
1 parent 5f2bc67 commit 092712b

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/loader.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ module.exports = function (content) {
5151
// 针对 entry 的 main.js 处理 page 和 app 的入口文件和配置等
5252
const mpOptions = loaderUtils.getOptions(this) || {}
5353

54+
if (!mpOptions.fileExt) {
55+
throw new Error(
56+
'[mpvue-loader] need "fileExt" option in file "build/vue-loader.conf.js",init a new project and copy the directory "build/" to this porject, or just check the "fileExt" option'
57+
)
58+
}
5459
if (mpOptions.checkMPEntry) {
5560
return compileMP.call(this, content, mpOptions)
5661
}

lib/mp-compiler/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const {
2222

2323
function genComponentMPML (compiled, options, emitFile, emitError, emitWarning, fileExt) {
2424
options.components['slots'] = { src: '/components/slots', name: 'slots' }
25+
debugger
2526
const { code: mpmlContent, compiled: compiledResult, slots, importCode } = compiler.compileToMPML(compiled, options, fileExt)
2627
const { mpErrors, mpTips } = compiledResult
2728
// 缓存 slots,延迟编译

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mpvue-loader",
3-
"version": "1.2.0",
3+
"version": "1.2.2",
44
"description": "mpvue single-file component loader for Webpack",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)