mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Update all packages to the most recent version
To support this, the following changes have to be made as well: - Ignore `package-lock.json` since NPM creates it, but we should not have it in the repository. - Switch from `babel-preset-es2015` to `babel-preset-env` to resolve the deprecation warning in the test logs. The latter is more recent and flexible, but should be the same functionality-wise. - `transform` now needs to have the `utf-8` encoding option provided. If not given, it will call the callback with a `Buffer` object, which results in an unhandled promise rejection since what is returned from the callback is a string, not a `Buffer`.
This commit is contained in:
parent
3717757b39
commit
0733b54e10
4 changed files with 30 additions and 29 deletions
|
@ -152,7 +152,7 @@ function createWebpackConfig(defines, output) {
|
|||
loader: 'babel-loader',
|
||||
exclude: /src\/core\/(glyphlist|unicode)/, // babel is too slow
|
||||
options: {
|
||||
presets: pdfjsNext ? undefined : ['es2015'],
|
||||
presets: pdfjsNext ? undefined : ['env'],
|
||||
plugins: ['transform-es2015-modules-commonjs'],
|
||||
},
|
||||
},
|
||||
|
@ -999,7 +999,7 @@ gulp.task('lib', ['buildnumber'], function () {
|
|||
content = preprocessor2.preprocessPDFJSCode(ctx, content);
|
||||
content = babel.transform(content, {
|
||||
sourceType: 'module',
|
||||
presets: noPreset ? undefined : ['es2015'],
|
||||
presets: noPreset ? undefined : ['env'],
|
||||
plugins: [
|
||||
'transform-es2015-modules-commonjs',
|
||||
babelPluginReplaceNonWebPackRequire,
|
||||
|
@ -1043,7 +1043,7 @@ gulp.task('lib', ['buildnumber'], function () {
|
|||
'!web/compatibility.js',
|
||||
], { base: '.', }),
|
||||
gulp.src('test/unit/*.js', { base: '.', }),
|
||||
]).pipe(transform(preprocess))
|
||||
]).pipe(transform('utf8', preprocess))
|
||||
.pipe(gulp.dest('build/lib/'));
|
||||
return merge([
|
||||
buildLib,
|
||||
|
@ -1316,7 +1316,7 @@ gulp.task('dist-pre',
|
|||
license: DIST_LICENSE,
|
||||
dependencies: {
|
||||
'node-ensure': '^0.0.0', // shim for node for require.ensure
|
||||
'worker-loader': '^0.8.0', // used in external/dist/webpack.json
|
||||
'worker-loader': '^1.0.0', // used in external/dist/webpack.json
|
||||
},
|
||||
browser: {
|
||||
'fs': false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue