mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 12:28:44 -05:00
fix: fix pwa + ts + lint (close #937)
This commit is contained in:
@@ -17,7 +17,7 @@ module.exports = api => {
|
||||
// inject import for registerServiceWorker script into main.js
|
||||
const lines = main.split(/\r?\n/g).reverse()
|
||||
const lastImportIndex = lines.findIndex(line => line.match(/^import/))
|
||||
lines[lastImportIndex] += `\nimport './registerServiceWorker${isTS ? `.ts` : ``}'`
|
||||
lines[lastImportIndex] += `\nimport './registerServiceWorker'`
|
||||
files[file] = lines.reverse().join('\n')
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user