我要从旧的NPM模块中取出2012年。我设法创建了一个发行版并添加了UMD。尽管这个问题相当笼统,here's my current code
当我进行webpack打包时,uglifier会更改类的名称(正如您所期望的那样。)因此,现在我在控制台中看到以下内容:
> window.cJ
ƒ d(t, e, n) {
_classCallCheck(this, d);
"function" == typeof e && (n = e, e = {});return l.get(t, e, function (t, e) {
if (t) return n(t);d.parse(e, n);
}), !0;
}
我想保留我的类名,因为它们是描述性的。为了使模块用户能够自己进行调试,我宁愿选择Client还是Collection或Item。我什至都不在乎所有这些,我很乐意提供排除清单。甚至关闭uglifier。任何帮助将不胜感激。
这是package.json文件:
{
"name": "collection-json",
"version": "0.2.1",
"description": "Collection+JSON Client",
"private": true,
"scripts": {
"client": "make client",
"test": "jest"
},
"jest": {
"transform": {
"^.+\\.js?$": "babel-jest"
}
},
"license": "MIT",
"dependencies": {
"node-fetch": "^2.3.0"
},
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"babel-core": "^6.26.3",
"babel-loader": "^8.0.4",
"babel-preset-es2015": "^6.24.1",
"net": "^1.0.2",
"should": "~1.2.0",
"tls": "0.0.1",
"uglify-js": "^3.4.9",
"webpack": "^4.26.1",
"webpack-cli": "^3.1.2"
}
}