dojo / cli-build-webpack

🚀 **DEPRECATED** Dojo 2 - cli command for building applications
http://dojo.io
Other
4 stars 19 forks source link

Service worker support #168

Closed maier49 closed 7 years ago

maier49 commented 7 years ago

Type: bug / feature

The following has been addressed in the PR:

Description:

Relates to dojo/meta#169. Adds a flag --serviceWorker. If this flag is specified, and not running in watch mode or building tests, the process.env.DOJO_SERVICE_WORKER flag will be set to true, and the sw-precache-webpack-plugin will be enabled, adding support for caching all resources with a service worker to the app.

The hacker news PWA PR, which is still a WIP, if built with this branch will work offline. With this and the changes it depends on in dojo/stores for IndexedDB the entire app currently runs offline after the first load.

maier49 commented 7 years ago

I addressed the comments here, with the exceptions that I didn't change DOJO_CLI because it's not set here, and I haven't tackled the more general testing issue.

maier49 commented 7 years ago

@kitsonk @matt-gadd All the feedback here has been addressed and it's been rebased against the latest.

agubler commented 7 years ago

@maier49 apologies seems we have conflicts again, can we resolve them so we can get this merged. Thanks!

maier49 commented 7 years ago

In light of the concerns mentioned in this comment, we will take a different approach for supporting service workers and other PWA features. It will involve using .dojorc and generating appropriate files in cli-build-webpack, as opposed to adding code to cli-create-app that may not apply in all cases.