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

Problem with ESM import syntax with pluginutils #348

Closed
brettz9 opened this issue Jan 22, 2020 · 2 comments
Closed

Problem with ESM import syntax with pluginutils #348

brettz9 opened this issue Jan 22, 2020 · 2 comments

Comments

@brettz9
Copy link

brettz9 commented Jan 22, 2020

Hi,

Thanks for the very handy plugin.

As per rollup/plugins#171 , it seems that as long as pluginutils is exporting a default (only), your ESM syntax at

import { createFilter } from 'rollup-pluginutils';
should by importing it with a syntax like this instead:

import pluginutils from 'rollup-pluginutils';

const {createFilter} = pluginutils;

And actually, with the old version of pluginutils deprecated, it really should be pointing to @rollup/pluginutils instead:

import pluginutils from '@rollup/pluginutils';

const {createFilter} = pluginutils;
@brettz9
Copy link
Author

brettz9 commented Jan 22, 2020

Btw, while it may work with some compilers or configurations, the above is required for those which adhere strictly to ESM.

@Andarist
Copy link
Member

Andarist commented Jan 22, 2020

There is an ongoing effort to migrate this plugin to the plugins monorepo - rollup/plugins#108 . I'm afraid we won't be fixing this for v4, but I will make sure that it's fixed for the upcoming v5 (which is going to be released when this mentioned PR lands). Hope you understand.

Fixed there in rollup/plugins@050ceca

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

No branches or pull requests

2 participants