Skip to content

Conversation

skeggse
Copy link
Contributor

@skeggse skeggse commented Oct 14, 2019

Marking this statement as pure provides a workaround for #239 via live code inclusion/treeshaking and the disabling of function annotations. For example, a rollup configuration object like this will fully prune usage of flow-aws-lambda with annotate: false configured:

import babel from 'rollup-plugin-babel';

export default {
  input: './index.js',
  output: {
    file: './dist/index.js',
    format: 'cjs',
  },
  external: ['flow-aws-lambda'],
  treeshake: {
    pureExternalModules: true,
  },
  plugins: [
    babel({
      plugins: [['flow-runtime', { annotate: false }]],
      presets: ['@babel/preset-flow'],
    }),
  ],
};

Marking this statement as pure provides a workaround for the runtime
types being unused via live code inclusion/treeshaking and the
disabling of function annotations.
@skeggse
Copy link
Contributor Author

skeggse commented Nov 5, 2019

@gajus does this seem reasonable (not a comprehensive solution but not problematic)?

@gajus
Copy link
Owner

gajus commented Nov 5, 2019

This solution seems fine. However, can you please add a test case (even though there are others that are failing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants