Skip to content

Commit

Permalink
fix: code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Mar 15, 2021
1 parent 139324c commit 448ca3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
13 changes: 0 additions & 13 deletions lib/TemplatedPathPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

"use strict";

const crypto = require("crypto");
const { basename, extname } = require("path");
const util = require("util");
const Chunk = require("./Chunk");
Expand Down Expand Up @@ -93,14 +92,6 @@ const deprecated = (fn, message, code) => {
};
};

/**
* @param {string} path path
* @returns {string} hash
*/
const hashPath = path => {
return crypto.createHash("md5").update(path).digest("hex").slice(0, 8);
};

/**
* @param {string | function(PathData, AssetInfo=): string} path the raw path
* @param {PathData} data context data
Expand Down Expand Up @@ -311,10 +302,6 @@ const replacePathVariables = (path, data, assetInfo) => {
return match;
});

if (path.length > 100) {
path = path.slice(0, 100) + hashPath(path);
}

return path;
};

Expand Down
8 changes: 4 additions & 4 deletions test/Stats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ describe("Stats", () => {
"assets": Array [
Object {
"name": "entryB.js",
"size": 2940,
"size": 2942,
},
],
"assetsSize": 2940,
"assetsSize": 2942,
"auxiliaryAssets": undefined,
"auxiliaryAssetsSize": 0,
"childAssets": undefined,
Expand Down Expand Up @@ -221,10 +221,10 @@ describe("Stats", () => {
"info": Object {
"javascriptModule": false,
"minimized": true,
"size": 2940,
"size": 2942,
},
"name": "entryB.js",
"size": 2940,
"size": 2942,
"type": "asset",
},
Object {
Expand Down

0 comments on commit 448ca3d

Please sign in to comment.