@modern-js/app-tools 2.11.1-alpha.0 → 2.11.1-alpha.1

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.
@@ -71,9 +71,13 @@ class RouterPlugin {
71
71
  chunks: true,
72
72
  ids: true
73
73
  });
74
- const { publicPath, chunks = [], assetsByChunkName } = stats;
74
+ const {
75
+ publicPath,
76
+ chunks = [],
77
+ assetsByChunkName,
78
+ namedChunkGroups
79
+ } = stats;
75
80
  const routeAssets = {};
76
- const { namedChunkGroups } = stats;
77
81
  if (!namedChunkGroups || !assetsByChunkName) {
78
82
  import_utils.logger.warn(
79
83
  "Route manifest does not exist, performance will be affected"
@@ -81,15 +85,16 @@ class RouterPlugin {
81
85
  return;
82
86
  }
83
87
  for (const [name, chunkGroup] of Object.entries(namedChunkGroups)) {
84
- const referenceCssAssets = chunkGroup.assets.filter((asset) => /\.css$/.test(asset.name)).map((asset) => {
85
- const item = asset.name;
86
- return publicPath ? normalizePath(publicPath) + item : item;
88
+ const assets = chunkGroup.assets.map((asset) => {
89
+ const filename2 = asset.name;
90
+ return publicPath ? normalizePath(publicPath) + filename2 : filename2;
87
91
  });
92
+ const referenceCssAssets = assets.filter(
93
+ (asset) => /\.css$/.test(asset)
94
+ );
88
95
  routeAssets[name] = {
89
96
  chunkIds: chunkGroup.chunks,
90
- assets: assetsByChunkName[name].map(
91
- (item) => publicPath ? normalizePath(publicPath) + item : item
92
- ),
97
+ assets,
93
98
  referenceCssAssets
94
99
  };
95
100
  }
@@ -237,7 +237,7 @@ var RouterPlugin = /*#__PURE__*/ function() {
237
237
  name: PLUGIN_NAME,
238
238
  stage: PROCESS_ASSETS_STAGE_REPORT
239
239
  }, /*#__PURE__*/ _asyncToGenerator(function() {
240
- var stats, publicPath, _stats_chunks, chunks, assetsByChunkName, routeAssets, namedChunkGroups, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, name, chunkGroup, referenceCssAssets, manifest, injectedContent, entrypointsArray, entryChunkIds, entryChunks, entryChunkFiles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, file, asset, newContent, filename;
240
+ var stats, publicPath, _stats_chunks, chunks, assetsByChunkName, namedChunkGroups, routeAssets, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, name, chunkGroup, assets, referenceCssAssets, manifest, injectedContent, entrypointsArray, entryChunkIds, entryChunks, entryChunkFiles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, file, asset, newContent, filename;
241
241
  return __generator(this, function(_state) {
242
242
  switch(_state.label){
243
243
  case 0:
@@ -249,9 +249,8 @@ var RouterPlugin = /*#__PURE__*/ function() {
249
249
  chunks: true,
250
250
  ids: true
251
251
  });
252
- publicPath = stats.publicPath, _stats_chunks = stats.chunks, chunks = _stats_chunks === void 0 ? [] : _stats_chunks, assetsByChunkName = stats.assetsByChunkName;
252
+ publicPath = stats.publicPath, _stats_chunks = stats.chunks, chunks = _stats_chunks === void 0 ? [] : _stats_chunks, assetsByChunkName = stats.assetsByChunkName, namedChunkGroups = stats.namedChunkGroups;
253
253
  routeAssets = {};
254
- namedChunkGroups = stats.namedChunkGroups;
255
254
  if (!namedChunkGroups || !assetsByChunkName) {
256
255
  logger.warn("Route manifest does not exist, performance will be affected");
257
256
  return [
@@ -262,17 +261,16 @@ var RouterPlugin = /*#__PURE__*/ function() {
262
261
  try {
263
262
  for(_iterator = Object.entries(namedChunkGroups)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
264
263
  _step_value = _slicedToArray(_step.value, 2), name = _step_value[0], chunkGroup = _step_value[1];
265
- referenceCssAssets = chunkGroup.assets.filter(function(asset) {
266
- return /\.css$/.test(asset.name);
267
- }).map(function(asset) {
268
- var item = asset.name;
269
- return publicPath ? normalizePath(publicPath) + item : item;
264
+ assets = chunkGroup.assets.map(function(asset) {
265
+ var filename2 = asset.name;
266
+ return publicPath ? normalizePath(publicPath) + filename2 : filename2;
267
+ });
268
+ referenceCssAssets = assets.filter(function(asset) {
269
+ return /\.css$/.test(asset);
270
270
  });
271
271
  routeAssets[name] = {
272
272
  chunkIds: chunkGroup.chunks,
273
- assets: assetsByChunkName[name].map(function(item) {
274
- return publicPath ? normalizePath(publicPath) + item : item;
275
- }),
273
+ assets: assets,
276
274
  referenceCssAssets: referenceCssAssets
277
275
  };
278
276
  }
@@ -39,9 +39,13 @@ class RouterPlugin {
39
39
  chunks: true,
40
40
  ids: true
41
41
  });
42
- const { publicPath, chunks = [], assetsByChunkName } = stats;
42
+ const {
43
+ publicPath,
44
+ chunks = [],
45
+ assetsByChunkName,
46
+ namedChunkGroups
47
+ } = stats;
43
48
  const routeAssets = {};
44
- const { namedChunkGroups } = stats;
45
49
  if (!namedChunkGroups || !assetsByChunkName) {
46
50
  logger.warn(
47
51
  "Route manifest does not exist, performance will be affected"
@@ -49,15 +53,16 @@ class RouterPlugin {
49
53
  return;
50
54
  }
51
55
  for (const [name, chunkGroup] of Object.entries(namedChunkGroups)) {
52
- const referenceCssAssets = chunkGroup.assets.filter((asset) => /\.css$/.test(asset.name)).map((asset) => {
53
- const item = asset.name;
54
- return publicPath ? normalizePath(publicPath) + item : item;
56
+ const assets = chunkGroup.assets.map((asset) => {
57
+ const filename2 = asset.name;
58
+ return publicPath ? normalizePath(publicPath) + filename2 : filename2;
55
59
  });
60
+ const referenceCssAssets = assets.filter(
61
+ (asset) => /\.css$/.test(asset)
62
+ );
56
63
  routeAssets[name] = {
57
64
  chunkIds: chunkGroup.chunks,
58
- assets: assetsByChunkName[name].map(
59
- (item) => publicPath ? normalizePath(publicPath) + item : item
60
- ),
65
+ assets,
61
66
  referenceCssAssets
62
67
  };
63
68
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.11.1-alpha.0",
14
+ "version": "2.11.1-alpha.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/cjs/index.js",
@@ -69,22 +69,22 @@
69
69
  "es-module-lexer": "^1.1.0",
70
70
  "esbuild": "0.15.7",
71
71
  "@modern-js/builder": "2.11.0",
72
- "@modern-js/builder-plugin-esbuild": "2.11.0",
73
- "@modern-js/builder-plugin-node-polyfill": "2.11.0",
74
72
  "@modern-js/builder-shared": "2.11.0",
75
73
  "@modern-js/builder-webpack-provider": "2.11.0",
76
74
  "@modern-js/core": "2.11.0",
77
- "@modern-js/new-action": "2.11.0",
78
75
  "@modern-js/node-bundle-require": "2.11.0",
79
76
  "@modern-js/plugin": "2.11.0",
80
- "@modern-js/plugin-lint": "2.11.0",
77
+ "@modern-js/plugin-data-loader": "2.11.0",
81
78
  "@modern-js/plugin-i18n": "2.11.0",
79
+ "@modern-js/plugin-lint": "2.11.0",
82
80
  "@modern-js/prod-server": "2.11.0",
83
81
  "@modern-js/server": "2.11.0",
84
- "@modern-js/types": "2.11.0",
85
- "@modern-js/upgrade": "2.11.0",
86
82
  "@modern-js/utils": "2.11.0",
87
- "@modern-js/plugin-data-loader": "2.11.0"
83
+ "@modern-js/upgrade": "2.11.0",
84
+ "@modern-js/types": "2.11.0",
85
+ "@modern-js/builder-plugin-node-polyfill": "2.11.0",
86
+ "@modern-js/builder-plugin-esbuild": "2.11.0",
87
+ "@modern-js/new-action": "2.11.0"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@types/babel__traverse": "^7.14.2",
@@ -93,11 +93,11 @@
93
93
  "jest": "^29",
94
94
  "typescript": "^4",
95
95
  "webpack": "^5.76.2",
96
+ "@modern-js/builder-rspack-provider": "2.11.0",
96
97
  "@scripts/build": "2.11.0",
97
- "@modern-js/builder-plugin-swc": "2.11.0",
98
- "@scripts/jest-config": "2.11.0",
99
98
  "@modern-js/server-core": "2.11.0",
100
- "@modern-js/builder-rspack-provider": "2.11.0"
99
+ "@scripts/jest-config": "2.11.0",
100
+ "@modern-js/builder-plugin-swc": "2.11.0"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "@modern-js/builder-rspack-provider": "^2.11.0"