Skip to content

Tree shaking is broken in React apps #855

@vladshcherbin

Description

@vladshcherbin

tl;dr After failing with webpack tree shaking, I gave rollup a shot. Unfortunately, it's not working here too.

The test case is a simple app with React & React Router v3. Link component is not used, but the whole router package is bundled.

import React from 'react'
import ReactDOM from 'react-dom'
import { Link } from 'react-router'

ReactDOM.render(
  <p>Hey</p>,
  document.getElementById('app')
)

Webpack & Rollup test repo

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