PavelVanecek / gulp-crx

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

No output #19

Closed xvilo closed 5 years ago

xvilo commented 6 years ago

Hi,

I have, I think, setup everything correctly. But i'm getting no output or error message from the plugin...

My code:

gulp.task('crx', ['default'], function() {
    // http://example.com/extension.crx
    var manifest = JSON.parse(fs.readFileSync('./manifest.json'));
    var codebase = 'http://redacted.domain/enagement-check.crx';
    var updateXmlFilename = 'update.xml';
    console.log(fs.readFileSync('./certs/key.pem', 'utf8'), manifest.savename + '.crx', codebase, updateXmlFilename);
    return gulp.src('.')
        .pipe(crx({
            privateKey: fs.readFileSync('./certs/key.pem', 'utf8'),
            filename: manifest.savename + '.crx',
            codebase: codebase,
            updateXmlFilename: updateXmlFilename
        }))
        .pipe(gulp.dest('./dist'));
});

Terminal output:

$ gulp crx
[21:29:43] Using gulpfile /bla/bla/project/gulpfile.js
[21:29:43] Starting 'default'...
[21:29:44] Finished 'default' after 1.02 s
[21:29:44] Starting 'crx'...
-----BEGIN PRIVATE KEY-----
[REDACTED OF COURSE]
-----END PRIVATE KEY-----
 enagement-check.crx http://redacted.domain/enagement-check.crx update.xml
^C

Not sure whats going on on here

PavelVanecek commented 6 years ago

It hangs and does nothing, right? I can see the same on my computer. I'll try to figure out what is wrong. Thanks for reporting!

PavelVanecek commented 6 years ago

Aha! crx was loading and attempting to archive all the files in directory, including node_modules and everything. When I moved the manifest.json file to a subdirectory it helped. Can you try that and see if it helps?

gulp.src('./src') // because '.' packs too much
xvilo commented 6 years ago

Okay, give me a moment, I will check today

marcelklehr commented 6 years ago

Shouldn't it also work to specify an exclude pattern in gulp.src? For some reason it runs forever for me, I suspect it's trying to package node_modules even though I've excluded that dir.