当我使用webpack和UglifyjsWebpackPlugin时,我尝试缩小代码:
// this is test.js
export const ceil = Math.ceil
export const random = Math.random
// webpack entry
import { ceil } from './test'
export default ceil(3.3)
我有 :
// formated
"use strict";
n.d(t,"a",function(){return r});
var r=Math.ceil;
Math.random// still exist?
如果我缩小
// this is test.js
export const ceil = Math.ceil
export const random = 1 // or string
我会正常的。
那么,为什么Math.random
还存在呢?摇树不行吗?
webpack:3.10.0
UglifyjsWebpackPlugin:1.1.6
谢谢!