rollup / rollup-plugin-babel

This package has moved and is now available at @rollup/plugin-babel / https://github.com/rollup/plugins/tree/master/packages/babel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with ESM import syntax with pluginutils

brettz9 opened this issue · comments

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;

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

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