mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
[api-major] Remove the SINGLE_FILE
build target
Please note that this build target, and the resulting `build/pdf.combined.js` file, is equivalent to setting the `PDFJS.disableWorker` option to `true` which is a performance footgun.
This commit is contained in:
parent
55e3f97aa9
commit
c56f3f04dd
4 changed files with 7 additions and 40 deletions
27
gulpfile.js
27
gulpfile.js
|
@ -48,7 +48,6 @@ var BASELINE_DIR = BUILD_DIR + 'baseline/';
|
|||
var MOZCENTRAL_BASELINE_DIR = BUILD_DIR + 'mozcentral.baseline/';
|
||||
var GENERIC_DIR = BUILD_DIR + 'generic/';
|
||||
var COMPONENTS_DIR = BUILD_DIR + 'components/';
|
||||
var SINGLE_FILE_DIR = BUILD_DIR + 'singlefile/';
|
||||
var MINIFIED_DIR = BUILD_DIR + 'minified/';
|
||||
var FIREFOX_BUILD_DIR = BUILD_DIR + 'firefox/';
|
||||
var CHROME_BUILD_DIR = BUILD_DIR + 'chromium/';
|
||||
|
@ -79,7 +78,6 @@ var DEFINES = {
|
|||
MOZCENTRAL: false,
|
||||
CHROME: false,
|
||||
MINIFIED: false,
|
||||
SINGLE_FILE: false,
|
||||
COMPONENTS: false,
|
||||
LIB: false,
|
||||
SKIP_BABEL: false,
|
||||
|
@ -235,10 +233,6 @@ function createBundle(defines) {
|
|||
|
||||
var mainAMDName = 'pdfjs-dist/build/pdf';
|
||||
var mainOutputName = 'pdf.js';
|
||||
if (defines.SINGLE_FILE) {
|
||||
mainAMDName = 'pdfjs-dist/build/pdf.combined';
|
||||
mainOutputName = 'pdf.combined.js';
|
||||
}
|
||||
|
||||
var mainFileConfig = createWebpackConfig(defines, {
|
||||
filename: mainOutputName,
|
||||
|
@ -250,9 +244,6 @@ function createBundle(defines) {
|
|||
.pipe(webpack2Stream(mainFileConfig))
|
||||
.pipe(replaceWebpackRequire())
|
||||
.pipe(replaceJSRootName(mainAMDName));
|
||||
if (defines.SINGLE_FILE) {
|
||||
return mainOutput; // don't need a worker file.
|
||||
}
|
||||
|
||||
var workerAMDName = 'pdfjs-dist/build/pdf.worker';
|
||||
var workerOutputName = 'pdf.worker.js';
|
||||
|
@ -634,18 +625,6 @@ gulp.task('components', ['buildnumber'], function () {
|
|||
]);
|
||||
});
|
||||
|
||||
gulp.task('singlefile', ['buildnumber'], function () {
|
||||
console.log();
|
||||
console.log('### Creating singlefile build');
|
||||
var defines = builder.merge(DEFINES, { SINGLE_FILE: true, });
|
||||
|
||||
var SINGLE_FILE_BUILD_DIR = SINGLE_FILE_DIR + 'build/';
|
||||
|
||||
rimraf.sync(SINGLE_FILE_DIR);
|
||||
|
||||
return createBundle(defines).pipe(gulp.dest(SINGLE_FILE_BUILD_DIR));
|
||||
});
|
||||
|
||||
gulp.task('minified-pre', ['buildnumber', 'locale'], function () {
|
||||
console.log();
|
||||
console.log('### Creating minified viewer');
|
||||
|
@ -1275,9 +1254,7 @@ gulp.task('gh-pages-git', ['gh-pages-prepare', 'wintersmith'], function () {
|
|||
|
||||
gulp.task('web', ['gh-pages-prepare', 'wintersmith', 'gh-pages-git']);
|
||||
|
||||
gulp.task('dist-pre',
|
||||
['generic', 'singlefile', 'components', 'lib', 'minified'],
|
||||
function () {
|
||||
gulp.task('dist-pre', ['generic', 'components', 'lib', 'minified'], function() {
|
||||
var VERSION = getVersionJSON().version;
|
||||
|
||||
console.log();
|
||||
|
@ -1359,8 +1336,6 @@ gulp.task('dist-pre',
|
|||
GENERIC_DIR + 'build/pdf.js.map',
|
||||
GENERIC_DIR + 'build/pdf.worker.js',
|
||||
GENERIC_DIR + 'build/pdf.worker.js.map',
|
||||
SINGLE_FILE_DIR + 'build/pdf.combined.js',
|
||||
SINGLE_FILE_DIR + 'build/pdf.combined.js.map',
|
||||
SRC_DIR + 'pdf.worker.entry.js',
|
||||
]).pipe(gulp.dest(DIST_DIR + 'build/')),
|
||||
gulp.src(MINIFIED_DIR + 'build/pdf.js')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue