Is there a gulp plugin that is connected to wires from packages of yarn?

I am currently using an activator and explorer to connect all my dependencies to the source file, but I want to remove the conversation and use yarn. In the two plugins, I only mention bell support.

The problem with yarn is that all packages are installed in. / node_modules / while bower has its own folder. / bower_components /.

+4
source share
1 answer

I believe this should work for you:

var packageJSON = require('./package.json');
var dependencies = Object.keys(packageJSON && packageJSON.dependencies || {});

gulp.task('vendor', function() {
  return browserify()
    .require(dependencies)
    .bundle()
    .pipe(source('vendor.bundle.js'))
    .pipe(gulp.dest(__dirname + '/public/scripts'));
});

gulp.task('todo', function() {
  return browserify('app/scripts/app.js')
    .external(dependencies)
    .bundle()
    .pipe(source('todo.bundle.js'))
    .pipe(map.write('./'))
    .pipe(gulp.dest(__dirname + '/public/scripts'));
});
0
source

Source: https://habr.com/ru/post/1688374/


All Articles