standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.26k stars 147 forks source link

Export error esm with gulp4 #901

Closed ghost closed 3 years ago

ghost commented 3 years ago

Gulp: To use esm we should

But running gulp this produces

[17:24:41] Requiring external module esm
/home/sm/blog/gulpfile.esm.js:139
export minify
       ^

SyntaxError: Invalid or unexpected token
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)

Any ideas?

ghost commented 3 years ago

That is a wrong export.

Use export {module1, module2}. In this case export {minify}