PavelVanecek / gulp-crx

Pack Chrome Extension in the pipeline.
31 stars 3 forks source link

Starting 'crx'... never finishes #6

Closed nitinsurana closed 8 years ago

nitinsurana commented 8 years ago
gulp.task('crx', function() {
    return gulp.src('.')
        .pipe(crx({
            privateKey: fs.readFileSync('./repeatit.pem', 'utf8'),
            filename: 'RepeatIt' + '.crx'
        }))
        .pipe(gulp.dest('./build'));
});

After running the above task gulp crx, it just took 1.2min although chrome://extensions pack extension took less than 5 seconds.

PavelVanecek commented 8 years ago

I just tested it on a new extension and it finishes well under a second. Could you provide more detail?

$ time npm run crx

[23:47:38] Using gulpfile ~/foo/dummy-extension/gulpfile.js
[23:47:38] Starting 'crx'...
[23:47:38] Finished 'crx' after 77 ms

real    0m0.948s
user    0m0.790s
sys 0m0.127s
nitinsurana commented 8 years ago

I believe it's because of .git, .idea & node_modules folder.

I tried gulp.src(['.' , '!node_modules', '!node_modules/**', '!.idea', '!.idea/**']) but still the folders are getting in the .crx

PavelVanecek commented 8 years ago

Try moving all the sources into a subfolder:

$ ls
> gulpfile.js  node_modules  package.json   src
gulp.task('crx', function() {
  return gulp.src('src/')
  // ...
nitinsurana commented 8 years ago

yeah, did that for now. Although exclusion should work, ain't it ?

PavelVanecek commented 8 years ago

I have mixed experience with exclusion filters, different tools understand it in different ways. Separate folder is simpler. But in theory, yes, that should work.