Skip to content
This repository was archived by the owner on Aug 13, 2022. It is now read-only.
This repository was archived by the owner on Aug 13, 2022. It is now read-only.

Feature: Support tree shaking. #11

@ryan-roemer

Description

@ryan-roemer

Background

https://unpkg.com/react@16.13.0/index.js is simply:

if (process.env.NODE_ENV === 'production') {
  module.exports = require('./cjs/react.production.min.js');
} else {
  module.exports = require('./cjs/react.development.js');
}

If we know NODE_ENV (see: #2 ) we could filter to only one of these dependencies to further trace instead of both as currently happens.

Work

Filter out dependency files that aren't used by the intro srcPath file.

  • ESM: Pretty much what webpack does already for package.json:module ESM code.
  • CommonJS: Has correctness challenges at the outset. Research and consider options here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions