Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Allow plugin to disregard non-ES2015 modules #91

Closed
Rich-Harris opened this issue Mar 31, 2017 · 0 comments · Fixed by #96
Closed

Allow plugin to disregard non-ES2015 modules #91

Rich-Harris opened this issue Mar 31, 2017 · 0 comments · Fixed by #96

Comments

@Rich-Harris
Copy link
Contributor

You can configure this plugin to disregard external packages that don't have a pkg.module property, but what you're really doing when you do that is excluding non-ES2015 packages.

But that fails when it's a deep import:

import { print } from 'graphql/language/printer';

The plugin happily resolves this path, not considering what type of file it is. And that can cause problems. I propose we add an option to specifically exclude non-ES2015 modules, using the unambiguous grammar proposal. Maybe something like this:

plugins: [
  resolve({
    modulesOnly: true // would also automatically set `module: true, jsnext: true`
  })
]

Any thoughts?

Ref Rich-Harris/packd#2 (#90 is part of that, but we'd still need this).

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

Successfully merging a pull request may close this issue.

1 participant