mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Replacing custom bundling with webpack2.
This commit is contained in:
parent
d7cb46dafc
commit
eb4c88cd44
12 changed files with 330 additions and 321 deletions
30
external/webpack/pdfjsdev-loader.js
vendored
Normal file
30
external/webpack/pdfjsdev-loader.js
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* Copyright 2017 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* eslint-env node */
|
||||
|
||||
'use strict';
|
||||
|
||||
var preprocessor2 = require('../builder/preprocessor2.js');
|
||||
|
||||
module.exports = function (source) {
|
||||
// Options must be specified, ignoring request if not.
|
||||
if (!this.query || typeof this.query !== 'object') {
|
||||
return source;
|
||||
}
|
||||
this.cacheable();
|
||||
var ctx = this.query;
|
||||
source = preprocessor2.preprocessPDFJSCode(ctx, source);
|
||||
return source;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue