We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1585947 commit 8298f95Copy full SHA for 8298f95
lib/module.js
@@ -1,3 +1,6 @@
1
+const { resolve } = require('path')
2
+const serveStatic = require('serve-static')
3
+
4
module.exports = async function nuxtPWA (moduleOptions) {
5
const { nuxt } = this
6
const moduleContainer = this // TODO: remove dependency when module-utils
@@ -41,6 +44,15 @@ module.exports = async function nuxtPWA (moduleOptions) {
41
44
}
42
45
await require(`./${name}/module.js`)(nuxt, pwa, moduleContainer)
43
46
47
48
+ // Serve dist from disk
49
+ if (nuxt.options.dev) {
50
+ const clientDir = resolve(nuxt.options.buildDir, 'dist/client')
51
+ nuxt.options.serverMiddleware.push({
52
+ path: nuxt.options.build.publicPath,
53
+ handler: serveStatic(clientDir)
54
+ })
55
+ }
56
57
58
module.exports.meta = require('../package.json')
0 commit comments