Permalink
Browse files

fix(workbox): more fixes regarding nuxt 2 dist directory changes. fixes

  • Loading branch information...
pi0 committed Aug 25, 2018
1 parent c7102fd commit 7a8bb3bf0469093b3f57a75d2a934860edee4fbf
Showing with 13 additions and 4 deletions.
  1. +11 −3 packages/workbox/index.js
  2. +2 −1 test/__snapshots__/pwa.test.js.snap
@@ -30,8 +30,16 @@ module.exports = function nuxtWorkbox (moduleOptions) {
// Get client output path (#83)
this.extendBuild((config, { isClient }) => {
if (isClient && !options.globDirectory) {
options.globDirectory = config.output.path
if (!isClient) {
return
}
if (!options.clientBuildDir) {
options.clientBuildDir = config.output.path
}
if (!options.globDirectory) {
options.globDirectory = options.clientBuildDir
}
})
@@ -177,7 +185,7 @@ function emitAssets (options) {
// Write assets after build
const hook = builder => {
assets.forEach(({ source, dst }) => {
writeFileSync(path.resolve(this.options.buildDir, 'dist', dst), source, 'utf-8')
writeFileSync(path.resolve(options.clientBuildDir, dst), source, 'utf-8')
})
}
@@ -28,12 +28,12 @@ Array [
"fixture/.nuxt/dist/client/ons.40ac840e.js",
"fixture/.nuxt/dist/client/pages",
"fixture/.nuxt/dist/client/pages/index.js",
"fixture/.nuxt/dist/client/workbox.dev.42554690.js",
"fixture/.nuxt/dist/server",
"fixture/.nuxt/dist/server/index.spa.html",
"fixture/.nuxt/dist/server/index.ssr.html",
"fixture/.nuxt/dist/server/server-bundle.json",
"fixture/.nuxt/dist/server/vue-ssr-client-manifest.json",
"fixture/.nuxt/dist/workbox.dev.42554690.js",
"fixture/.nuxt/empty.js",
"fixture/.nuxt/index.js",
"fixture/.nuxt/layouts",
@@ -75,6 +75,7 @@ Array [
"fixture/dist/_nuxt/ons.40ac840e.js",
"fixture/dist/_nuxt/pages",
"fixture/dist/_nuxt/pages/index.js",
"fixture/dist/_nuxt/workbox.dev.42554690.js",
"fixture/dist/custom-sw.js",
"fixture/dist/icon.png",
"fixture/dist/index.html",

0 comments on commit 7a8bb3b

Please sign in to comment.