gulp-sprockets
gulp-sprockets copied to clipboard
Example gulpfile is not working with an error "$.sprockets.declare is not a function"
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.
Hi @5t111111 yeah Im having an error $.sprockets.default is not a function
any work around?
Thanks
@delacruzjames as I wrote, try changing $.sprockets to $.sprockets.default like $.sprockets.default.declare()