I am currently working on a project using Gulp 4 and Webpack 5 with Bootstrap 5. During the script bundling process, I have noticed that Gulp generates a bundle.js
file as expected, but it also creates a bundle.js.LICENSE.js
file.
After examining my build task, I couldn't find anything that would cause this additional file to be generated.
Interestingly, this seems to occur only when I use import 'bootstrap'
or
import Popper from 'popper.js/dist/umd/popper'
.
Is there a way to prevent the generation of the LICENSE file? It's possible that Bootstrap 5's JavaScript contains something that triggers Gulp or Webpack to create it.
Any insights or suggestions would be greatly appreciated. Below is the snippet of my build scripts task:
// Build Scripts Task
const buildScripts = (mode) => (done) => {
let streamMode;
if (mode === 'development') {
streamMode = require('./webpack/config.development.js');
} else if (mode === 'production') {
streamMode = require('./webpack/config.production.js');
} else {
streamMode = undefined;
}
['development', 'production'].includes(mode) ? pump([
gulp.src(srcPath('js')),
vinylNamed(),
webpackStream(streamMode, webpack),
gulpSourcemaps.init({ loadMaps: true }),
through2.obj(function (file, enc, cb) {
const isSourceMap = /\.map$/.test(file.path);
if (!isSourceMap) {
this.push(file);
}
cb();
}),
gulpBabel({
presets: ['@babel/preset-env'],
}),
...((mode === 'production') ? [gulpUglify()] : []),
gulpSourcemaps.write('./'),
gulp.dest(distPath('js')),
browserSync.stream(),
], done) : undefined;
};