Skip to content

Static analysis to eliminate dead code #1061

@jknight12882

Description

@jknight12882

webpack is able to do static analysis on the following UMD code to remove it while rollup leaves it behind.

  // UMD wrapper.
  /*global define:false*/
  if (typeof exports === "object" && typeof module === "object") {
    // CommonJS
    module.exports = _lload;

  } else if (typeof define === "function" && define.amd) {
    // AMD
    define([], function () { return _lload; });

  } else {
    // VanillaJS
    window._lload = _lload;
  }

this should be replace by

if (true) {
    // CommonJS
    module.exports = _lload;
    ...

which can then be eliminated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions