admin管理员组文章数量:1291060
How to disable in Webpack to rename of function names? I have got in my code this name of class:
import { MenuBlocksMenuPage } from "../pages/menu/blocks/menupage";
But in compiled file the row becomes to unreadable string.
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__pages_menu_blocks_menupage__ = __webpack_require__(669);
My question is: What is the option in Webpack that can to disable the change of class or functions name?
How to disable in Webpack to rename of function names? I have got in my code this name of class:
import { MenuBlocksMenuPage } from "../pages/menu/blocks/menupage";
But in compiled file the row becomes to unreadable string.
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__pages_menu_blocks_menupage__ = __webpack_require__(669);
My question is: What is the option in Webpack that can to disable the change of class or functions name?
Share Improve this question edited Feb 17, 2017 at 14:38 Alexander Zakusilo asked Feb 17, 2017 at 14:17 Alexander ZakusiloAlexander Zakusilo 1,5564 gold badges18 silver badges34 bronze badges1 Answer
Reset to default 30I am running into the same issue, the TerserPlugin pointed to by Andrew Mackie's link will address the issue, but is also a pretty heavy solution. One option would be changing how the optimization setting in webpack works. A convenient approach (without having given in huge thought) would be:
optimization: {
minimize: true|false|"compress"|"preserve"
}
"compress" would remove white space but not mangle "preserve" would minimize but not mangle function and class names
Here is the Terser configuration for webpack.conf:
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
keep_fnames: true
}
})
]
},
本文标签: How to disable in Webpack to rename of function names TypeScriptJavaScriptStack Overflow
版权声明:本文标题:How to disable in Webpack to rename of function names? TypeScript, Javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738286670a2072978.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论