aboutsummaryrefslogtreecommitdiff
path: root/lib/docx/docx-reader.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-04-27 13:24:51 +0100
committerMichael Williamson <mike@zwobble.org>2024-04-27 13:24:51 +0100
commit4bd14e9b3de8e7077e013f652712058e37f3e261 (patch)
tree7d87fc8f805093d3c05d4c9aace07d6472b00ba7 /lib/docx/docx-reader.js
parent5ac58a1269b3d5e55adb17730cd965ace7970b11 (diff)
Don't use path module in browser builds
Diffstat (limited to 'lib/docx/docx-reader.js')
-rw-r--r--lib/docx/docx-reader.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/docx/docx-reader.js b/lib/docx/docx-reader.js
index 5f0fd05..0d72cd7 100644
--- a/lib/docx/docx-reader.js
+++ b/lib/docx/docx-reader.js
@@ -1,8 +1,6 @@
exports.read = read;
exports._findPartPaths = findPartPaths;
-var path = require("path");
-
var promises = require("../promises");
var documents = require("../documents");
var Result = require("../results").Result;
@@ -27,7 +25,7 @@ function read(docxFile, input) {
contentTypes: readContentTypesFromZipFile(docxFile),
partPaths: findPartPaths(docxFile),
docxFile: docxFile,
- files: new Files(input.path ? path.dirname(input.path) : null)
+ files: input.path ? Files.relativeToFile(input.path) : new Files(null)
}).also(function(result) {
return {
styles: readStylesFromZipFile(docxFile, result.partPaths.styles)