Polymer / pwa-starter-kit

Starter templates for building full-featured Progressive Web Apps from web components.
https://pwa-starter-kit.polymer-project.org
2.36k stars 431 forks source link

Rollup build Uncaught promise Service Worker? #381

Closed sdykae closed 4 years ago

sdykae commented 4 years ago

Is rollup branch for deployment? I cant get the static build to success ;c

sdykae commented 4 years ago

image

sdykae commented 4 years ago

Ahm, I tried this rollup config file

import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import  WorkboxRollupPlugin from 'rollup-plugin-workbox';

export default [{
  input: './src/components/my-app.js',
  output: [
    {
      dir: 'public/dist',
      format: 'esm'
    }
  ],
  plugins: [
    resolve({
      jsnext: true
    })
  ]
},
{
  input: './src/components/my-app.js',
  output: [
    {
      dir: 'public/dist_nomodule',
      format: 'system'
    }
  ],
  plugins: [
    resolve({
      // use "jsnext:main" if possible
      // legacy field pointing to ES6 module in third-party libraries,
      // deprecated in favor of "pkg.module":
      // - see: https://github.com/rollup/rollup/wiki/pkg.module
      jsnext: true,  // Default: false
    }),
    babel({
      "presets": [
        ["@babel/preset-env", {"targets": {"ie": "11"}}]
      ],
      "plugins": ["@babel/plugin-syntax-dynamic-import"]
    }),
    WorkboxRollupPlugin({
      mode:'generateSW',
      workboxConfig: {
      globDirectory: '',
      globPatterns: ['index.html','manifest.json','*.js'],
      navigateFallback: 'index.html',
      swDest: 'public/service-worker.js',
      clientsClaim: true,
      skipWaiting: true,
      runtimeCaching: [
        {
          urlPattern: /^https:\/\/fonts.gstatic.com\//,
          handler: 'staleWhileRevalidate'
        }
      ]
    }})
  ]
}];

Outputs the missing worker but not the precache manifest. help?

stale[bot] commented 4 years ago

This project is no longer under development and will be transitioning to a read-only repo. Thank you for your contributions.