When I use webpack and UglifyjsWebpackPlugin, I try to minify code:
// 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)
I got :
// formated
"use strict";
n.d(t,"a",function(){return r});
var r=Math.ceil;
Math.random// still exist?
and if I minify
// this is test.js
export const ceil = Math.ceil
export const random = 1 // or string
I will get normal.
So, why Math.random
still exist?
tree shaking not work?
webpack: 3.10.0
UglifyjsWebpackPlugin: 1.1.6
Thanks!