ritz078/rollup-plugin-filesize

SyntaxError: unknown: 'import' and 'export' may appear only with 'sourceType: "module"'

Closed this issue · 2 comments

rollup version 0.66.6
rollup-plugin-filesize version 5.0.0

When build with output.format = esm throws an error:

[!] (filesize plugin) SyntaxError: unknown: 'import' and 'export' may appear only with 'sourceType: "module"'
Consider renaming the file to '.mjs', or setting sourceType:module or sourceType:unambiguous in your Babel config for this file.

With rollup-plugin-filesize version 4.0.1 there is no such problem.

Experiencing same issue. Fixed for now by downgrading to v4

should be fixed in 5.0.1