UNPKG

@nuxtjs/workbox

Version:

👉 Please refer to [nuxt-community/pwa-module](https://github.com/nuxt-community/pwa-module) for documentation.

19 lines (16 loc) • 426 B
const { readFileSync, existsSync } = require('fs') function readJSFiles (files) { return Array.from(Array.isArray(files) ? files : [files]) .map(path => { path = this.nuxt.resolver.resolvePath(path) if (path && existsSync(path)) { return readFileSync(path, 'utf8') } else { throw new Error('Can not read ' + path) } }) .join('\n\n') } module.exports = { readJSFiles }