Skip to content

The pipe argument for createGulpEsbuild does not work as expected: #16

Description

@Sanshain

First I use createGulpEsbuild as here:

const esBuild = createGulpEsbuild({
	pipe: true,
	incremental: true,
})

and inside tasks I have the following sequential data processing:

.pipe(someChanges())
.pipe(
  esBuild({
	bundle: true,
	mainFields: [
		"svelte", "browser", "module", "main"
	],
	outdir: release ? './scripts/release' : "./scripts",
	format: 'iife',
	target: 'es6',
	write: true,
	loader: {
		'.svg': 'text',
		'.png': 'file',
	},
	plugins: [
		esbuildSvelte({
			preprocess: sveltePreprocess(),
		}),
	],
})
)

The problem:

to ebuild(...) call the source data arrives without changes made in the stream inside the someChanges() plugin

However (!), the changes come if before esBuild I make a save using .gulp.dest('build.FS/src/') as here:

.pipe(someChanges())
.pipe(.gulp.dest('build.FS/src/'))
.pipe(
  esBuild({
     ...
  })
)

As far as I understand from readme that pipe argument is responsible for receiving data from the stream (by default is disabled):

piping allows you to receive data from other plugins via stream piping (example).

(in readme its named piping, but in source code there is pipe (I guess it hasn't been fixed yet))

Thus, I am prone to believe that there is some kind of bug here. But I did a little digging in the source code, and I didn't find exactly how this logic should work

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions