on-internet
← Community

Webpack sideEffects won't remove unused function

Stack Overflow ·

In the babel-loader I am declaring side-effects to false which means that any unused function should be removed from the bundle. But in my case logFour function remains. util.js export function logThree() { console.log(3); } export function logFour() { console.log(4); } logThree(); logFour(); index.js import { logThree } from "./util"; logThree(); bundle.js (() => { "use strict"; function o() { console.log(3); } o(), console.log(4), o(); })(); webpack module.exports = { mode: "production", entry: ["./src/index"], devtool: "source-map", output: { path: path.resolve("dist/"), publicPath: "/publi

Comments

Sign in or sign up to comment and upvote.

No comments yet.