Skip to content

Commit

Permalink
Upgrade dependencies to fix audit issues (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
eKoopmans committed Aug 31, 2021
1 parent e2bcb98 commit d97c69e
Show file tree
Hide file tree
Showing 13 changed files with 8,368 additions and 12,390 deletions.
14 changes: 0 additions & 14 deletions .babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
last 1 version
> 1%
IE >= 9
9 changes: 9 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
[ "@babel/preset-env", {
"useBuiltIns": "usage",
"corejs": { "version": "3.10", "proposals": true }
}]
],
"sourceType": "unambiguous"
}
63 changes: 25 additions & 38 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
// Karma configuration

// Load Rollup dependencies
const rollupConfig = {
resolve: require('rollup-plugin-node-resolve'),
commonjs: require('rollup-plugin-commonjs'),
replace: require('rollup-plugin-replace'),
babel: require('rollup-plugin-babel')
}

module.exports = function(config) {
config.set({

Expand All @@ -22,11 +14,11 @@ module.exports = function(config) {

// list of files / patterns to load in the browser
files: [
{ pattern: 'src/index.js', watched: false },
{ pattern: 'src/index.js', watched: false, served: true },
{ pattern: 'test/**/*.js', watched: true },
{ pattern: 'test/reference/*.*', included: false, served: true },
{ pattern: require.resolve('pdftest/dist/pdftest.client.min.js'), watched: false },
{ pattern: require.resolve('pdftest/dist/chai-pdftest.min.js'), watched: false },
'test/**/*.js'
],


Expand All @@ -39,8 +31,8 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/index.js': ['rollup'],
'test/**/*.js': ['rollupTests'],
'src/index.js': ['webpack'],
'test/**/*.js': ['webpackTests'],
},


Expand Down Expand Up @@ -91,39 +83,34 @@ module.exports = function(config) {
},


// Rollup preprocessor
// Setup as a normal Rollup config object, just without the input
// It has its own autoWatch behaviour, so Karma's file watcher must be disabled on its files
rollupPreprocessor: {
webpackPreprocessor: {
output: {
name: 'html2pdf',
format: 'iife',
globals: {
jspdf: 'jsPDF',
html2canvas: 'html2canvas'
}
library: 'html2pdf',
libraryExport: 'default',
},
target: 'browserslist',
optimization: { minimize: false },
watch: true,
module: {
rules: [
{
test: /\.m?js$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
],
},
plugins: [
rollupConfig.resolve(),
rollupConfig.commonjs(),
rollupConfig.replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
rollupConfig.babel({ exclude: 'node_modules/**' })
]
},

customPreprocessors: {
rollupTests: {
base: 'rollup',
webpackTests: {
base: 'webpack',
options: {
output: {
name: 'html2pdf_test',
format: 'iife',
globals: {
html2pdf: 'html2pdf',
},
},
output: {},
externals: ['html2pdf'],
externalsType: 'global',
},
},
},
})
});
}

0 comments on commit d97c69e

Please sign in to comment.