@mpxjs/webpack-plugin 2.8.17 → 2.8.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,13 +95,19 @@ function compileScriptSetup (
95
95
  node,
96
96
  end
97
97
  ) {
98
- throw new Error(
99
- `[@mpxjs/webpack-plugin script-setup-compiler] ${msg}\n\n${filePath}\n${formatCodeFrame(
100
- content,
101
- node.start + startOffset,
102
- end
103
- )}`
104
- )
98
+ if (node) {
99
+ throw new Error(
100
+ `[@mpxjs/webpack-plugin script-setup-compiler] ${msg}\n\n${filePath}\n${formatCodeFrame(
101
+ content,
102
+ node.start + startOffset,
103
+ end
104
+ )}`
105
+ )
106
+ } else {
107
+ throw new Error(
108
+ `[@mpxjs/webpack-plugin script-setup-compiler] ${msg}\n\n${filePath}\n`
109
+ )
110
+ }
105
111
  }
106
112
 
107
113
  function registerUserImport (
@@ -600,6 +606,11 @@ function compileScriptSetup (
600
606
  }
601
607
  }
602
608
 
609
+ // 添加defineExpose强制配置校验
610
+ if (!hasDefineExposeCall) {
611
+ error('Mpx script setup must define the variables for return using defineExpose, see details: https://mpxjs.cn/guide/composition-api/composition-api.html#defineexpose')
612
+ }
613
+
603
614
  // import {createComponent} from '@mpxjs/core' 添加是否已有import判断
604
615
  const ctor = getCtor(ctorType)
605
616
  _s.prependLeft(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.8.17",
3
+ "version": "2.8.19",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -82,5 +82,5 @@
82
82
  "engines": {
83
83
  "node": ">=14.14.0"
84
84
  },
85
- "gitHead": "65458d02d8bfd5c49863f4e467e48ae76c382628"
85
+ "gitHead": "fca1b61f52c2ed8b3926e7b8a3a150d27904911a"
86
86
  }