gulpjs / gulpjs.github.io

The gulp website
http://gulpjs.com
45 stars 44 forks source link

Wrong module syntax on gulpjs.com / Named export 'dest' not found. #137

Closed Sebi2020 closed 2 years ago

Sebi2020 commented 2 years ago

What actually happened?

gulpjs.com shows example, which do not work, cause gulp is a CommonJS module, but the examples use ES-Module Syntax:

image

Which causes the following error:

import {src, dest} from 'gulp';
             ^^^^
SyntaxError: Named export 'dest' not found. The requested module 'gulp' is a CommonJS module, which may not support all module.exports as named exports.
phated commented 2 years ago

These examples are meant to be used in a gulpfile.esm.js and require the esm module to be installed.

Sebi2020 commented 2 years ago

@phated shouldn't this be mentioned on the page? The getting started did not even mention that there is an esm module. It's really confusing if you mix different import styles on the pages.

phated commented 2 years ago

No, these are just flashy examples and not something you should be used as "getting started". There's a giant menu button to the getting started guide.