Closed mohammadrafigh closed 3 months ago
Hi! I can't reproduce the problem because sourcemaps are generated.
gulpfile.js
const { src, dest } = require('gulp')
const gulpEsbuild = require('gulp-esbuild')
function build() {
return src('./src/*.js')
.pipe(gulpEsbuild({
bundle: true,
target: 'es2022',
sourcemap: true,
outfile: 'main.min.js',
minify: true
}))
.pipe(dest('./dist'))
}
exports.build = build;
src/a.js
function sum(a, b) {
return a + b;
}
function printAll() {
console.log('sum1', sum(5, 10));
}
printAll()
package.json
{
"private": true,
"scripts": {
"build": "gulp build"
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-esbuild": "latest"
}
}
command line
npm run build
I got dist/main.min.js
, dist/main.min.js.map
with correct content.
Well, it seems it's not working on gulp 5.0.0.
Oops, sorry it seems I had a misconfiguration somewhere else. Thanks for being responsible.
Enabling sourcemap doesn't output sourcemap and just returns the bundle, or maybe I missed something? For example: