Skip to content

Use with node_modules and commonjs requires #1773

@supersteves

Description

@supersteves

I'm exploring using Closure Compiler with node_modules and have run into a couple of blocking issues:

  • Moocher dropping. All CJS modules are being considered moochers because they don't "provide" anything. I need moocher dropping in my codebase to avoid pulling in tons of unused files for compilation.
  • node_module path resolution. I'm happy to write my paths explicitly like require("react-bootstrap/lib/Action.js") but where the module I'm requiring itself requires e.g. "react" rather than "react/main.js", it's an error. For this I'd like to supply my own loader which implements node_modules rules and package json awareness.

As it stands I think I can only realistically use CJS requires (or ES6 imports) when importing my own code rather than complex pre-existing libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions