Skip to content

Commit b15f68c

Browse files
committed
add bowser dependency
1 parent 39665bd commit b15f68c

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"dist"
3939
],
4040
"dependencies": {
41+
"bowser": "^2.11.0",
4142
"uzip": "0.20201231.0"
4243
},
4344
"devDependencies": {

rollup.config.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import path from 'path'
1010
const pkg = require('./package.json')
1111
const notExternal = [
1212
// 'pako',
13-
'uzip'
13+
'uzip',
14+
'bowser',
1415
]
1516
const external = Object.keys(pkg.dependencies).filter(value => !notExternal.includes(value))
1617

@@ -19,7 +20,7 @@ let plugins = [
1920
babel(),
2021
terser({
2122
keep_fnames: true,
22-
mangle: { reserved: ['CustomFile', 'CustomFileReader', 'UPNG', 'UZIP'] }
23+
mangle: { reserved: ['CustomFile', 'CustomFileReader', 'UPNG', 'UZIP', 'bowser'] }
2324
}),
2425
license({
2526
sourcemap: true,
@@ -46,7 +47,8 @@ export default {
4647
sourcemap: true,
4748
globals: {
4849
// pako: 'pako',
49-
uzip: 'UZIP'
50+
uzip: 'UZIP',
51+
bowser: 'bowser'
5052
}
5153
},
5254
{
@@ -55,8 +57,10 @@ export default {
5557
sourcemap: true,
5658
globals: {
5759
// pako: 'pako',
58-
uzip: 'UZIP'
60+
uzip: 'UZIP',
61+
bowser: 'bowser'
5962
}
60-
}
63+
},
64+
6165
]
6266
}

test/setup_jsdom.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ if (typeof window.Worker === 'undefined') {
88
}
99

1010
global.window = window
11-
const KEYS = ['document', 'Blob', 'File', 'URL', 'Worker', 'FileReader', 'atob', 'Uint8Array', 'Image', 'HTMLCanvasElement', 'HTMLImageElement']
11+
const KEYS = ['document', 'navigator', 'Blob', 'File', 'URL', 'Worker', 'FileReader', 'atob', 'Uint8Array', 'Image', 'HTMLCanvasElement', 'HTMLImageElement']
1212
KEYS.forEach(key => global[key] = window[key])
1313

1414
if (typeof window.URL.createObjectURL === 'undefined') {
1515
Object.defineProperty(window.URL, 'createObjectURL', { value: () => {} })
16-
}
16+
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,11 @@ binary-extensions@^2.0.0:
12191219
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9"
12201220
integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==
12211221

1222+
bowser@^2.11.0:
1223+
version "2.11.0"
1224+
resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.11.0.tgz#5ca3c35757a7aa5771500c70a73a9f91ef420a8f"
1225+
integrity sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==
1226+
12221227
brace-expansion@^1.1.7:
12231228
version "1.1.11"
12241229
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"

0 commit comments

Comments
 (0)