serviceworker in universal angular

1

I'm trying to use services worker with universal angle, all right, except for one thing, I have my client.js file which is the minimized file of angular.js

This is my index.html

<html>
<head>
  <meta charset="UTF-8">
  <base href="/">
  <title>Universal</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<link href="/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">

<!-- Optional theme -->
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap-theme.min.css">
<script src="/bower_components/jquery/dist/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script>
  if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('/service-worker.js').then(function(registration) {
      // Registration was successful
      console.log('ServiceWorker registration successful with scope: ', registration.scope);
    }).catch(function(err) {
      // registration failed :(
      console.log('ServiceWorker registration failed: ', err);
    });
  }
</script>
</head>
<body>
  <demo-app></demo-app>

</body>
</html>

my sw-precache.config is the following

module.exports = {
  staticFileGlobs: [
    'dist/**.html',
    'dist/client.js',
    'bower_components/**/*.css',
    'bower_components/**/*.js'
  ],
  maximumFileSizeToCacheInBytes:4200000,
  root: 'dist',
  stripPrefix:'dist/',
  navigateFallback:'/index.html'
};

Cache everything, up to the client.js, however when I enter the browser, it brings me all the files registered in the servicework cache, except the client.js, because I get an error saying that the memory was exceeded ( Uncaught (in promise) DOMException: Quota exceeded.) Client.js weighs 3.7 mb.

I am using jit to compile because I have not yet managed to implement aot, to reduce the size of the file, nor prepack (xmlhttprequest is not supported), what alternatives are there to solve this case? ,

    
asked by Kevin AB 13.07.2017 в 00:26
source

0 answers