Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-default exports break rollup.config.js #2682

Closed
swansontec opened this issue Feb 7, 2019 · 1 comment
Closed

Non-default exports break rollup.config.js #2682

swansontec opened this issue Feb 7, 2019 · 1 comment

Comments

@swansontec
Copy link
Contributor

swansontec commented Feb 7, 2019

  • Rollup Version: 1.0.0
  • Operating System (or Browser): OSX
  • Node Version: v11.4.0

How Do We Reproduce?

Create a rollup.config.js file with an extra non-default export:

export default {
  input: './index.js',
  output: { file: './out.js', format: 'cjs' }
}

export const redHerring = 1

Expected Behavior

This should still be a valid config file, since the non-default redHerring export shouldn't change anything.

Actual Behavior

Rollup fails with some warnings followed by an error:

(!) Mixing named and default exports
Consumers of your bundle will have to use bundle['default'] to access the default export, which may not be what you want. Use `output.exports: 'named'` to disable this warning
(!) You have passed an unrecognized option
Unknown input option: default, redHerring. Allowed options: acorn, acornInjectPlugins, cache, chunkGroupingSize, context, experimentalCacheExpiry, experimentalOptimizeChunks, experimentalTopLevelAwait, external, inlineDynamicImports, input, manualChunks, moduleContext, onwarn, perf, plugins, preserveModules, preserveSymlinks, shimMissingExports, treeshake, watch
undefined → stdout...
[!] Error: You must supply options.input to rollup

Pull request #2673 provides a solution to this problem.

@lukastaegert
Copy link
Member

Resolved via #2673

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

No branches or pull requests

2 participants