gulp-sprockets icon indicating copy to clipboard operation
gulp-sprockets copied to clipboard

Example gulpfile is not working with an error "$.sprockets.declare is not a function"

Open 5t111111 opened this issue 9 years ago • 2 comments

gulpfile.babel.js in Usage section doesn't work because of errors like "$.sprockets.declare is not a function".

For a workaround, I have to change $.sprockets to $.sprockets.default to make it work because exported sprockets is an object kind of { default: { css: [Function], js: [Function], precompile: [Function] scss [Function], declare: [Function] } }.

However, for my understanding it should work as long as you set __esModule as an property and export it as exports.default = sprockets that exactly I see in your codes. Furtheremore, if you do import sprockets from 'gulp-sprockets' without using gulp-load-plugins, it seems to work.

So it might be a problem related to gulp-load-plugins, but the example gulpfile is not working anyway.

5t111111 avatar Feb 21 '16 08:02 5t111111

Hi @5t111111 yeah Im having an error $.sprockets.default is not a function any work around?

Thanks

delacruzjames avatar Mar 19 '16 07:03 delacruzjames

@delacruzjames as I wrote, try changing $.sprockets to $.sprockets.default like $.sprockets.default.declare()

5t111111 avatar Mar 19 '16 11:03 5t111111