@mpxjs/webpack-plugin 2.8.0-beta.2 → 2.8.0-beta.4

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.
@@ -354,8 +354,8 @@ function compileScriptSetup (
354
354
  sourceType: 'module'
355
355
  })
356
356
  for (const node of scriptSetupAst.program.body) {
357
- const start = node.start + startOffset
358
- let end = node.end + startOffset
357
+ const start = node.start
358
+ let end = node.end
359
359
 
360
360
  // 定位comment,例如 var a= 1; // a为属性
361
361
  if (node.trailingComments && node.trailingComments.length > 0) {
@@ -605,7 +605,7 @@ function compileScriptSetup (
605
605
  _s.prependLeft(
606
606
  startOffset,
607
607
  `\nimport {${ctor}} from '${MPX_CORE}'\n${getCtor(ctorType)} ({${runtimeOptions}\n ` +
608
- `setup(${args}) {\n const useContext = () => { return __context }`
608
+ `setup(${args}) {\n const useContext = () => { return __context }\n`
609
609
  )
610
610
  _s.appendRight(endOffset, '})')
611
611
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.8.0-beta.2",
3
+ "version": "2.8.0-beta.4",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -44,6 +44,7 @@
44
44
  "lodash": "^4.17.15",
45
45
  "lodash.camelcase": "^4.3.0",
46
46
  "lru-cache": "^4.1.2",
47
+ "magic-string": "^0.26.2",
47
48
  "mime": "^2.2.2",
48
49
  "object-assign": "^4.1.1",
49
50
  "postcss": "^8.4.5",
@@ -81,5 +82,5 @@
81
82
  "engines": {
82
83
  "node": ">=14.14.0"
83
84
  },
84
- "gitHead": "cd57f83a9d47236f527bd51a8650119514f4b433"
85
+ "gitHead": "7a3dd6c2d0fceb31ee035e85b7f11091e31409d3"
85
86
  }