Akryum / Akryum/vue-cli-plugin-ssr

registerServiceWorker import not being removed from main.js when using semicolons

Aperta
#24 1 commento 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
441
Fork
69
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello, another quick fix here.

When invoking this plugin in a project with the pwa plugin and an eslint config that uses semicolons, the `registerServiceWorker` import line is not removed from `main.js`.

This can be resolved by doing this
```diff
-contents = contents.replace(/import ('|")\.\/registerServiceWorker('|")\n/, ``)
+contents = contents.replace(/import ('|")\.\/registerServiceWorker('|");?\n/, ``)
```

Here https://github.com/Akryum/vue-cli-plugin-ssr/blob/master/generator/index.js#L47

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.