@s-ui/bundler 9.8.0 → 9.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/registerServiceWorker.js
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict'
|
|
4
4
|
|
|
5
|
-
var noop = function() {}
|
|
5
|
+
var noop = function () {}
|
|
6
6
|
var SW_URL = '/service-worker.js'
|
|
7
7
|
|
|
8
8
|
/* eslint-disable no-console */
|
|
9
|
-
exports.register = function(options) {
|
|
9
|
+
exports.register = function (options) {
|
|
10
10
|
options = options || {}
|
|
11
11
|
var first = options.first || noop
|
|
12
12
|
var renovate = options.renovate || noop
|
|
13
13
|
|
|
14
14
|
if ('serviceWorker' in navigator) {
|
|
15
|
-
window.addEventListener('load', function() {
|
|
15
|
+
window.addEventListener('load', function () {
|
|
16
16
|
navigator.serviceWorker
|
|
17
17
|
.register(SW_URL)
|
|
18
|
-
.then(function(registration) {
|
|
19
|
-
registration.onupdatefound = function() {
|
|
18
|
+
.then(function (registration) {
|
|
19
|
+
registration.onupdatefound = function () {
|
|
20
20
|
var installingWorker = registration.installing
|
|
21
|
-
installingWorker.onstatechange = function() {
|
|
21
|
+
installingWorker.onstatechange = function () {
|
|
22
22
|
if (installingWorker.state === 'installed') {
|
|
23
23
|
if (navigator.serviceWorker.controller) {
|
|
24
24
|
// At this point, the old content will have been purged and
|
|
@@ -36,16 +36,16 @@ exports.register = function(options) {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
})
|
|
39
|
-
.catch(function(error) {
|
|
39
|
+
.catch(function (error) {
|
|
40
40
|
console.error('Error during service worker registration:', error)
|
|
41
41
|
})
|
|
42
42
|
})
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
exports.unregister = function() {
|
|
46
|
+
exports.unregister = function () {
|
|
47
47
|
if ('serviceWorker' in navigator) {
|
|
48
|
-
navigator.serviceWorker.ready.then(function(registration) {
|
|
48
|
+
navigator.serviceWorker.ready.then(function (registration) {
|
|
49
49
|
registration.unregister()
|
|
50
50
|
})
|
|
51
51
|
}
|
package/service-worker.js
CHANGED
|
@@ -41,7 +41,7 @@ function canConstructResponseFromBodyStream() {
|
|
|
41
41
|
* @param {Object} response
|
|
42
42
|
* @returns {Promise<Response>}
|
|
43
43
|
*/
|
|
44
|
-
const copyResponse = async function(response) {
|
|
44
|
+
const copyResponse = async function (response) {
|
|
45
45
|
const clonedResponse = response.clone()
|
|
46
46
|
|
|
47
47
|
const responseInit = {
|
package/shared/minify-js.js
CHANGED
|
@@ -13,11 +13,11 @@ const esbuildMinifier = ({sourceMap}) =>
|
|
|
13
13
|
|
|
14
14
|
const terserMinifier = ({extractComments, sourceMap}) =>
|
|
15
15
|
new TerserPlugin({
|
|
16
|
-
minify: TerserPlugin.
|
|
16
|
+
minify: TerserPlugin.terserMinify,
|
|
17
17
|
extractComments,
|
|
18
18
|
terserOptions: {
|
|
19
19
|
ecma: 5,
|
|
20
|
-
|
|
20
|
+
sourceMap: sourceMap !== 'none' && sourceMap !== false
|
|
21
21
|
}
|
|
22
22
|
})
|
|
23
23
|
|
|
@@ -273,7 +273,7 @@ function prepareProxy(proxy, appPublicFolder, servedPathname) {
|
|
|
273
273
|
// Modern browsers include text/html into `accept` header when navigating.
|
|
274
274
|
// However API calls like `fetch()` won’t generally accept text/html.
|
|
275
275
|
// If this heuristic doesn’t work well for you, use `src/setupProxy.js`.
|
|
276
|
-
context: function(pathname, req) {
|
|
276
|
+
context: function (pathname, req) {
|
|
277
277
|
return (
|
|
278
278
|
req.method !== 'GET' ||
|
|
279
279
|
(mayProxy(pathname) &&
|
|
@@ -47,7 +47,7 @@ const connection = new WebSocket(
|
|
|
47
47
|
// Unlike WebpackDevServer client, we won't try to reconnect
|
|
48
48
|
// to avoid spamming the console. Disconnect usually happens
|
|
49
49
|
// when developer stops the server.
|
|
50
|
-
connection.onclose = function() {
|
|
50
|
+
connection.onclose = function () {
|
|
51
51
|
if (typeof console !== 'undefined' && typeof console.info === 'function') {
|
|
52
52
|
console.info(
|
|
53
53
|
'The development server has disconnected.\nRefresh the page if necessary.'
|
|
@@ -151,7 +151,7 @@ function handleAvailableHash(hash) {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
// Handle messages from the server.
|
|
154
|
-
connection.onmessage = function(e) {
|
|
154
|
+
connection.onmessage = function (e) {
|
|
155
155
|
const message = JSON.parse(e.data)
|
|
156
156
|
switch (message.type) {
|
|
157
157
|
case 'hash':
|
|
@@ -242,10 +242,10 @@ function tryApplyUpdates(onHotUpdateSuccess) {
|
|
|
242
242
|
// // webpack 2 returns a Promise instead of invoking a callback
|
|
243
243
|
if (result && result.then) {
|
|
244
244
|
result.then(
|
|
245
|
-
function(updatedModules) {
|
|
245
|
+
function (updatedModules) {
|
|
246
246
|
handleApplyUpdates(null, updatedModules)
|
|
247
247
|
},
|
|
248
|
-
function(err) {
|
|
248
|
+
function (err) {
|
|
249
249
|
handleApplyUpdates(err, null)
|
|
250
250
|
}
|
|
251
251
|
)
|