@modern-js/builder 2.39.2 → 2.41.0

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.
@@ -48,8 +48,10 @@ const builderPluginDefine = () => ({
48
48
  env,
49
49
  target
50
50
  });
51
- var _JSON_stringify;
52
- const serializedVars = (0, import_lodash.mapValues)(globalVars, (value) => (_JSON_stringify = JSON.stringify(value)) !== null && _JSON_stringify !== void 0 ? _JSON_stringify : "undefined");
51
+ const serializedVars = (0, import_lodash.mapValues)(globalVars, (value) => {
52
+ var _JSON_stringify;
53
+ return (_JSON_stringify = JSON.stringify(value)) !== null && _JSON_stringify !== void 0 ? _JSON_stringify : "undefined";
54
+ });
53
55
  const defineExprs = config.source.define;
54
56
  chain.plugin(CHAIN_ID.PLUGIN.DEFINE).use(bundler.DefinePlugin, [
55
57
  {
@@ -67,13 +67,14 @@ async function printHeader(longestFileLength, longestLabelLength) {
67
67
  async function printFileSizes(stats, distPath) {
68
68
  const { fs, filesize, gzipSize, stripAnsi } = await Promise.resolve().then(() => __toESM(require("@modern-js/utils")));
69
69
  const formatAsset = (asset) => {
70
- const contents = fs.readFileSync(import_path.default.join(distPath, asset.name));
70
+ const fileName = asset.name.split("?")[0];
71
+ const contents = fs.readFileSync(import_path.default.join(distPath, fileName));
71
72
  const size = contents.length;
72
73
  const gzippedSize = gzipSize.sync(contents);
73
74
  return {
74
75
  size,
75
- folder: import_path.default.join(import_path.default.basename(distPath), import_path.default.dirname(asset.name)),
76
- name: import_path.default.basename(asset.name),
76
+ folder: import_path.default.join(import_path.default.basename(distPath), import_path.default.dirname(fileName)),
77
+ name: import_path.default.basename(fileName),
77
78
  gzippedSize,
78
79
  sizeLabel: filesize(size, {
79
80
  round: 1
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "engines": {
19
19
  "node": ">=14.0.0"
20
20
  },
21
- "version": "2.39.2",
21
+ "version": "2.41.0",
22
22
  "jsnext:source": "./src/index.ts",
23
23
  "types": "./dist/index.d.ts",
24
24
  "main": "./dist/index.js",
@@ -53,20 +53,20 @@
53
53
  "dependencies": {
54
54
  "@rsbuild/monorepo-utils": "0.0.7",
55
55
  "@svgr/webpack": "8.0.1",
56
- "@swc/helpers": "0.5.1",
56
+ "@swc/helpers": "0.5.3",
57
57
  "deepmerge": "^4.3.1",
58
58
  "jiti": "^1.20.0",
59
- "@modern-js/builder-shared": "2.39.2",
60
- "@modern-js/utils": "2.39.2"
59
+ "@modern-js/builder-shared": "2.41.0",
60
+ "@modern-js/utils": "2.41.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@types/babel__core": "^7.20.0",
63
+ "@types/babel__core": "^7.20.1",
64
64
  "@types/node": "^14",
65
65
  "typescript": "^5",
66
- "@modern-js/builder-webpack-provider": "2.39.2",
67
- "@modern-js/builder-rspack-provider": "2.39.2",
68
- "@scripts/build": "2.39.2",
69
- "@scripts/vitest-config": "2.39.2"
66
+ "@modern-js/builder-rspack-provider": "2.41.0",
67
+ "@modern-js/builder-webpack-provider": "2.41.0",
68
+ "@scripts/build": "2.41.0",
69
+ "@scripts/vitest-config": "2.41.0"
70
70
  },
71
71
  "publishConfig": {
72
72
  "registry": "https://registry.npmjs.org/",