Issue 1:
I'm trying my luck here.

entry: {
home: '/......../home.js'
},
output: {
publicPath: '/dist/',
filename: "js/[name]-[hash].js",
chunkFilename: "js/[name]-chunk-[chunkhash].js"
},

Expect:

js/home-70aa09e8630fee6b4bb2.js

Actually：

js/home-chunk-70aa09e8630fee6b4bb2.js

repository url

webpack version: 4.14.0

Node.js version: 9.6.1

Operating System: mac os

Issue 2:
Bug report

For example I do not have any duplicates of classes named BaseMeshBehavior, but in the output I see

class BaseMeshBehavior_BaseMeshBehavior extends Behavior_Behavior {

What is the current behavior?

renaming of identifiers although there are not more than one definition.

If the current behavior is a bug, please provide the steps to reproduce.

//@ts-check
const CWD = process.cwd();

const camelcase = require("camelcase");
const path = require("path");
const fs = require("fs");
const webpack = require("webpack");
const r = require("regexr").default;
const pkg = require(path.join(CWD, "package.json"));
const builderConfigPath = path.join(CWD, "builder.config.js");
const builderConfig = fs.existsSync(builderConfigPath)
? require(builderConfigPath)
: {};
const pkgNameParts = pkg.name.split("/");
const lastPkgNamePart = pkgNameParts[pkgNameParts.length - 1];
const globalName = builderConfig.globalName;
const NAME =
globalName === false || globalName === ""
? ""
: globalName || camelcase(lastPkgNamePart);

const alsoResolveRelativeToArchetype = () => [
path.relative(
CWD,
path.join(
path.dirname(require.resolve("builder-js-package")),
"node_modules"
)
),
"node_modules"
];

module.exports = {
entry: `.${path.sep}dist${path.sep}index`,
output: {
path: path.join(CWD, "dist"),
filename: "global.js",
library: NAME,
libraryTarget: "var" // alternative: "window"
},
resolve: {
modules: alsoResolveRelativeToArchetype(),
extensions: [".js"]
},
resolveLoader: {
modules: alsoResolveRelativeToArchetype()
},
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
}
]
},
plugins: [new webpack.optimize.ModuleConcatenationPlugin()],
devtool: "source-map",
mode: "production",
optimization: { minimize: true },
stats: { assets: false }
};

What is the expected behavior?

It should not rename anything if it is not necessary. At the moment, it seems to rename many of my classes, but there are no definitions of anything else with the same name so there's no reason to rename them (as far as I know).

For reference, Rollup doesn't rename them.

This is what I see in the output:

/* concated harmony reexport DeclarativeBase */__webpack_require__.d(__webpack_exports__, "DeclarativeBase", function() { return DeclarativeBase_DeclarativeBase; });
/* concated harmony reexport HTMLNode */__webpack_require__.d(__webpack_exports__, "HTMLNode", function() { return HTMLNode_HTMLNode; });
/* concated harmony reexport HTMLScene */__webpack_require__.d(__webpack_exports__, "HTMLScene", function() { return HTMLScene_HTMLScene; });
/* concated harmony reexport WebComponent */__webpack_require__.d(__webpack_exports__, "WebComponent", function() { return WebComponent_WebComponent; });
/* concated harmony reexport BaseGeometryBehavior */__webpack_require__.d(__webpack_exports__, "BaseGeometryBehavior", function() { return BaseGeometryBehavior_BaseGeometryBehavior; });
/* concated harmony reexport BaseMaterialBehavior */__webpack_require__.d(__webpack_exports__, "BaseMaterialBehavior", function() { return BaseMaterialBehavior_BaseMaterialBehavior; });
/* concated harmony reexport BaseMeshBehavior */__webpack_require__.d(__webpack_exports__, "BaseMeshBehavior", function() { return BaseMeshBehavior_BaseMeshBehavior; });
/* concated harmony reexport BasicMaterialBehavior */__webpack_require__.d(__webpack_exports__, "BasicMaterialBehavior", function() { return BasicMaterialBehavior_BasicMaterialBehavior; });
/* concated harmony reexport BoxGeometryBehavior */__webpack_require__.d(__webpack_exports__, "BoxGeometryBehavior", function() { return BoxGeometryBehavior_BoxGeometryBehavior; });
/* concated harmony reexport DefaultBehaviors */__webpack_require__.d(__webpack_exports__, "DefaultBehaviors", function() { return DefaultBehaviors_DefaultBehaviors; });
/* concated harmony reexport DOMNodeGeometryBehavior */__webpack_require__.d(__webpack_exports__, "DOMNodeGeometryBehavior", function() { return DOMNodeGeometryBehavior_DOMNodeGeometryBehavior; });
/* concated harmony reexport DOMNodeMaterialBehavior */__webpack_require__.d(__webpack_exports__, "DOMNodeMaterialBehavior", function() { return DOMNodeMaterialBehavior_DOMNodeMaterialBehavior; });
/* concated harmony reexport ObjModelBehavior */__webpack_require__.d(__webpack_exports__, "ObjModelBehavior", function() { return ObjModelBehavior_ObjModelBehavior; });
/* concated harmony reexport PhongMaterialBehavior */__webpack_require__.d(__webpack_exports__, "PhongMaterialBehavior", function() { return PhongMaterialBehavior_PhongMaterialBehavior; });
/* concated harmony reexport PlaneGeometryBehavior */__webpack_require__.d(__webpack_exports__, "PlaneGeometryBehavior", function() { return PlaneGeometryBehavior_PlaneGeometryBehavior; });
/* concated harmony reexport SphereGeometryBehavior */__webpack_require__.d(__webpack_exports__, "SphereGeometryBehavior", function() { return SphereGeometryBehavior_SphereGeometryBehavior; });
/* concated harmony reexport Cube */__webpack_require__.d(__webpack_exports__, "Cube", function() { return Cube_Cube; });
/* concated harmony reexport PushPaneLayout */__webpack_require__.d(__webpack_exports__, "PushPaneLayout", function() { return PushPaneLayout_PushPaneLayout; });

For each of those identifiers, there's only one of them anywhere in my project.

Related: #5463 (by @Michael-Tajmajer-Emrsn)

Other relevant information:

webpack version: 4.27.1

Node.js version: v13.5.0

Operating System: macOS

Additional tools: