Breaks dependency treeshaking? -- node-resolve
and commonjs
plugins should be first
#87
Labels
kind: support
Asking for support with something or a specific use case
problem: plugin order
The plugin order in this issue seems incompatible. See the "Compatibility" section in the README
scope: integration
Related to an integration, not necessarily to core (but could influence core)
What happens and why it is wrong
Hey
I'm new to rollup, and pretty new to typescript, but I'm evaluating both for use in a react component library with a focus on small bundle size. Just starting out really. Anyway - when writing my components in JS, rollup will tree shake dependencies and only bundle the functions in use. When I add the typescript plugin, this isn't done.
Steps to recreate:
In one of the demo components, the function
lifecycle
is used from the packagerecompose
. Nothing else fromrecompose
is used.yarn install
yarn build
cat dist/index.js | grep withState
and you will see the function
withState
fromrecompose
is included in the build. Now comment out the typescript plugin fromrollup.config.js
and re run the build and grep and you'll see thatwithState
is not bundled, though grep forlifecycle
and that has been included correctly.Am I doing it wrong? Not sure if this is my issue or something wrong with the plugin.
Environment
OS: Mac OS 10.13.4
Node: 8.11.1
Versions
rollup.config.js
tsconfig.json
package.json
plugin output with verbosity 3
log.txt
The text was updated successfully, but these errors were encountered: