@mpxjs/webpack-plugin 2.8.28-beta.3 → 2.8.28-beta.5

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.
package/lib/index.js CHANGED
@@ -524,6 +524,7 @@ class MpxWebpackPlugin {
524
524
  compilation.warnings = compilation.warnings.concat(warnings)
525
525
  compilation.errors = compilation.errors.concat(errors)
526
526
  const moduleGraph = compilation.moduleGraph
527
+
527
528
  if (!compilation.__mpx__) {
528
529
  // init mpx
529
530
  mpx = compilation.__mpx__ = {
@@ -774,9 +775,8 @@ class MpxWebpackPlugin {
774
775
  async.forEach(presentationalDependencies.filter((dep) => dep.mpxAction), (dep, callback) => {
775
776
  dep.mpxAction(module, compilation, callback)
776
777
  }, (err) => {
777
- rawProcessModuleDependencies.call(compilation, module, (innerErr) => {
778
- return callback(err || innerErr)
779
- })
778
+ if (err) compilation.errors.push(err)
779
+ rawProcessModuleDependencies.call(compilation, module, callback)
780
780
  })
781
781
  }
782
782
 
@@ -98,14 +98,7 @@ module.exports = function (content) {
98
98
  if (err) return callback(err)
99
99
  if (!this._compilation) return callback()
100
100
  const targetPath = path.relative(context, file)
101
- this._compilation.assets[targetPath] = {
102
- size: function size () {
103
- return stats.size
104
- },
105
- source: function source () {
106
- return content
107
- }
108
- }
101
+ this.emitFile(targetPath, content)
109
102
  callback()
110
103
  })
111
104
  }
package/lib/loader.js CHANGED
@@ -69,7 +69,7 @@ module.exports = function (content) {
69
69
 
70
70
  if (ctorType === 'app') {
71
71
  const appName = getEntryName(this)
72
- this._module.addPresentationalDependency(new AppEntryDependency(resourcePath, appName))
72
+ if (appName) this._module.addPresentationalDependency(new AppEntryDependency(resourcePath, appName))
73
73
  }
74
74
  const loaderContext = this
75
75
  const stringifyRequest = r => loaderUtils.stringifyRequest(loaderContext, r)
@@ -762,7 +762,7 @@ function parse (template, options) {
762
762
  },
763
763
  comment: function comment (text) {
764
764
  if (!currentParent) genTempRoot()
765
- if (options.hasComment) {
765
+ if (options.hasComment || /mpx_config_/.test(text)) {
766
766
  currentParent.children.push({
767
767
  type: 3,
768
768
  text: text,
@@ -223,18 +223,18 @@ module.exports = async function loader (content, map, meta) {
223
223
  imports.unshift({
224
224
  type: 'api_import',
225
225
  importName: '___CSS_LOADER_API_IMPORT___',
226
- url: stringifyRequest(this, require.resolve('./runtime/api'))
226
+ url: stringifyRequest(this, '!!' + require.resolve('./runtime/api'))
227
227
  })
228
228
 
229
229
  if (options.sourceMap) {
230
230
  imports.unshift({
231
231
  importName: '___CSS_LOADER_API_SOURCEMAP_IMPORT___',
232
- url: stringifyRequest(this, require.resolve('./runtime/sourceMaps'))
232
+ url: stringifyRequest(this, '!!' + require.resolve('./runtime/sourceMaps'))
233
233
  })
234
234
  } else {
235
235
  imports.unshift({
236
236
  importName: '___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___',
237
- url: stringifyRequest(this, require.resolve('./runtime/noSourceMaps'))
237
+ url: stringifyRequest(this, '!!' + require.resolve('./runtime/noSourceMaps'))
238
238
  })
239
239
  }
240
240
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.8.28-beta.3",
3
+ "version": "2.8.28-beta.5",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -20,13 +20,13 @@
20
20
  "@babel/parser": "^7.16.2",
21
21
  "@babel/traverse": "^7.16.0",
22
22
  "@babel/types": "^7.16.0",
23
- "@better-scroll/core": "^2.2.1",
24
- "@better-scroll/movable": "^2.2.1",
25
- "@better-scroll/observe-dom": "^2.2.1",
26
- "@better-scroll/pull-down": "^2.2.1",
27
- "@better-scroll/slide": "^2.2.1",
28
- "@better-scroll/wheel": "^2.2.1",
29
- "@better-scroll/zoom": "^2.2.1",
23
+ "@better-scroll/core": "^2.5.1",
24
+ "@better-scroll/movable": "^2.5.1",
25
+ "@better-scroll/observe-dom": "^2.5.1",
26
+ "@better-scroll/pull-down": "^2.5.1",
27
+ "@better-scroll/slide": "^2.5.1",
28
+ "@better-scroll/wheel": "^2.5.1",
29
+ "@better-scroll/zoom": "^2.5.1",
30
30
  "acorn-walk": "^7.2.0",
31
31
  "async": "^2.6.0",
32
32
  "consolidate": "^0.15.1",
@@ -82,5 +82,5 @@
82
82
  "engines": {
83
83
  "node": ">=14.14.0"
84
84
  },
85
- "gitHead": "17e31567bab825b2fb7b96f30e08d92fe1cc1038"
85
+ "gitHead": "f415e2d6a1c14b51b2cee6eb654205608f217401"
86
86
  }