move-nuxt-module
Advanced tools
Comparing version 1.3.0 to 1.4.0
16
index.js
@@ -6,5 +6,11 @@ const path = require("path"); | ||
async function asyncModule() { | ||
const { outputDir, dirName, version, type } = this.options.globalModuleOptions; | ||
const { | ||
outputDir, | ||
dirName, | ||
version, | ||
type, | ||
isBuildRelative, | ||
} = this.options.globalModuleOptions; | ||
this.nuxt.hook("generate:done", async nuxt => { | ||
this.nuxt.hook("generate:done", async (nuxt) => { | ||
const dir = path.join(nuxt.options.rootDir, "dist", outputDir); | ||
@@ -15,3 +21,5 @@ let entriePath = ""; | ||
} else if (type === "server") { | ||
entriePath = path.join(dir, dirName, version, "**/*.html"); | ||
entriePath = isBuildRelative | ||
? path.join(dir, "**/*.html") | ||
: path.join(dir, dirName, version, "**/*.html"); | ||
} else { | ||
@@ -24,3 +32,3 @@ entriePath = path.join(dir, "assets", dirName, version, "**/*.html"); | ||
vfs.src(entriePath).pipe( | ||
map(function(file, cb) { | ||
map(function (file, cb) { | ||
fse.removeSync(file.path); | ||
@@ -27,0 +35,0 @@ cb(null, file); |
{ | ||
"name": "move-nuxt-module", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
1293
36