Closed kr05 closed 4 years ago
You can remove polymer-cli from devDependencies in your package.json if you wish. I didn't remove it because I didn't want to break the functionality of the current build steps.
On Fri, Dec 13, 2019 at 5:59 AM tuomassa notifications@github.com wrote:
How should I use this? npm install still installs polymer-cli
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Polymer/pwa-starter-kit/pull/370?email_source=notifications&email_token=AC2JDECAIPMNGE67DRB6OODQYOILFA5CNFSM4IGBZYDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG2BOCQ#issuecomment-565450506, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2JDEFAORSMKOCTMC4TN33QYOILFANCNFSM4IGBZYDA .
This project is no longer under development and will be transitioning to a read-only repo. Thank you for your contributions.
This is my attempt at replacing polymer-cli with rollup. It includes the following:
Working npm start I take advantage of NODE_ENV to conditionally load the corrent my-app.js file. During the build process, 'development' is replaced with 'production' using the gulp-replace plugin.
Polymer/prpl-server + push-manifest.json I had trouble getting this to work, and after various attempts I ended up manually adding the corresponding routes for all builds (in this case, esm-bundled and es5-bundled).
Workbox for service worker generation I'm still fairly new to workbox, so please excuse the inefficient pre-caching of files and other problems I might not be aware of. This implementation has the bare minimum, which is a working service worker that enables offline usage.
I hope this can serve as a starting point for a production ready rollup configuration. I'll continue doing my research and improving this PR. Some of the problems that need to be fixed are:
98-99 performance score on lighthouse For some reason, it made the application slower by a tiny amount. This makes me very sad.
Bigger initial bundle size The original PWA Starter Kit weights just over 100kb. This particular rollup config is double the size, at around 200kb. My guess is that the chunks rollup creates include extra code that my-view1 doesn't need. Also, I'm not doing any minification.
You can take a look at a deployed version here: https://pwa-starter-kit-7efbc.appspot.com/