1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Removing "entry-loader" dependency from webpack.

This commit is contained in:
Yury Delendik 2016-04-13 08:24:25 -05:00
parent 127e6d7343
commit ae415f9e80
12 changed files with 45 additions and 17 deletions

View file

@ -10,15 +10,18 @@ var TMP_FILE_PREFIX = '../../build/browserify_';
gulp.task('build-bundle', function() {
return browserify('main.js', {output: TMP_FILE_PREFIX + 'main.tmp'})
.ignore(require.resolve('pdfjs-dist/build/pdf.worker')) // Reducing size
.bundle()
.pipe(source(TMP_FILE_PREFIX + 'main.tmp'))
.pipe(streamify(uglify()))
.pipe(rename('bundle.js'))
.pipe(rename('main.bundle.js'))
.pipe(gulp.dest(OUTPUT_PATH));
});
gulp.task('build-worker', function() {
return browserify('worker.js', {output: TMP_FILE_PREFIX + 'worker.tmp'})
// We can create our own viewer (see worker.js) or use already defined one.
var workerSrc = require.resolve('pdfjs-dist/build/pdf.worker.entry');
return browserify(workerSrc, {output: TMP_FILE_PREFIX + 'worker.tmp'})
.bundle()
.pipe(source(TMP_FILE_PREFIX + 'worker.tmp'))
.pipe(streamify(uglify({compress:{